How to retrieve images from MySQL database and display in an html tag

0 votes

I created a table using the  BLOB column to hold a jpeg file. on the MySQL database that I created using phpmyadmin.  

I am having trouble with the php variable $result here.

 catalog.php:

<body>
<?php
  $link = mysql_connect("localhost", "root", "");
  mysql_select_db("dvddb");
  $sql = "SELECT dvdimage FROM dvd WHERE id=1";
  $result = mysql_query("$sql");
  mysql_close($link);

?>
<img src="" width="175" height="200" />
</body>

How can I get the variable $result from PHP into the HTML so I can display it in the <img> tag?

Jun 19, 2022 in PHP by narikkadan
• 63,720 points
1,423 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
0 answers

How can I store and retrieve images from a MySQL database using PHP?

How can I insert an image in ...READ MORE

Jun 14, 2022 in PHP by narikkadan
• 63,720 points
461 views
0 votes
1 answer

How to retrieve or obtain data from the MySQL database using PHP?

Hello kartik,  Actually there are many functions that  ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,880 points
3,308 views
0 votes
1 answer

How to connect to SQL Server database from JavaScript in the browser?

Hello @kartik, You shouldn´t use client javascript to ...READ MORE

answered Jul 21, 2020 in PHP by Niroj
• 82,880 points
23,881 views
0 votes
1 answer

How to see indexes for a database or table in MySQL?

Hello @kartik, To see the index for a ...READ MORE

answered Aug 18, 2020 in PHP by Niroj
• 82,880 points
149,977 views
+1 vote
1 answer

How to restore MySQL database from physical files?

Hello @kartik, A MySQL MyISAM table is the ...READ MORE

answered Aug 20, 2020 in PHP by Niroj
• 82,880 points
1,214 views
0 votes
1 answer

How to get database structure in MySQL via query

Hello @kartik, Use this: DESCRIBE table; You can also use SHOW ...READ MORE

answered Aug 26, 2020 in PHP by Niroj
• 82,880 points
814 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
10,411 views
0 votes
1 answer
0 votes
1 answer

How to access PHP var from external javascript file?

Hello @kartik, You don't really access it, you ...READ MORE

answered Jul 6, 2020 in Java-Script by Niroj
• 82,880 points
7,628 views
0 votes
1 answer

How do I escape a single quote in SQL Server?

Hello @kartik, Single quotes are escaped by doubling ...READ MORE

answered Jul 21, 2020 in PHP by Niroj
• 82,880 points
6,143 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP