Can't get images to display in database
Please support our MySQL advertiser: Programming Forums
![]() |
•
•
Posts: 8
Reputation:
Solved Threads: 0
Yes, I know this is a common one, but I've inserted images in a database and can't for the life of me get them to display. And before anyone suggests I shouldn't do it, they are only small pictures and a maximum of four. I am currently using two pages to display the pictures. This is the main page:
And this is the supporting page (i.e. picupload3.php3):
mysql Syntax (Toggle Plain Text)
<? mysql_connect("localhost", "username", "password") OR die(mysql_error()); mysql_select_db("debname") OR die(mysql_error()); $result=mysql_query("SELECT * FROM newyddion") OR die("Can't Perform Query"); While($row=mysql_fetch_object($result)) { echo "<IMG SRC=\"picupload3.php3?id=$row->id\">"; } ?>
php Syntax (Toggle Plain Text)
<?php ini_set("register_globals",1); mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("debname") or die(mysql_error()); $result=mysql_query("SELECT pic1 FROM newyddion WHERE id=$id") or die("Can't perform Query"); $row=mysql_fetch_object($result); Header( "Content-type: image/jpg"); echo $row->pic1; ?>
Last edited by cscgal : Oct 13th, 2008 at 11:26 am. Reason: Added code tags
![]() |
Similar Threads
Other Threads in the MySQL Forum
- displaying image from database (PHP)
- Displaying images from mysql database (PHP)
- upload and display images (PHP)
- Displaying Images( buffered data ) from the Database using Java (Java)
- How store and download audio file in database? (PHP)
- how to display one image per day from an array? (JSP)
- Horizontal display of data on Repeater control in asp.net (ASP.NET)
- Resizing images from a SQL DataBase (ASP.NET)
Other Threads in the MySQL Forum
- Previous Thread: phpMyAdmin error
- Next Thread: please help (what's wrong?)
•
•
•
•
Views: 851 | Replies: 1 | Currently Viewing: 1 (0 members and 1 guests)





Linear Mode