| | |
Can't get images to display in database
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2008
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 12:26 pm. Reason: Added code tags
![]() |
Similar Threads
- How store and download audio file in database? (PHP)
- 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 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?)
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api aws bizspark breathalyzer changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





