Warning: fopen(../wellimg/ctco.jpg) [function.fopen]: failed to open stream: No such file or directory in /usr/home/jongillies/domains/autooutlet.govital.net/public_html/testing/image.php on line 53
Warning: filesize() [function.filesize]: stat failed for ../wellimg/ctco.jpg in /usr/home/jongillies/domains/autooutlet.govital.net/public_html/testing/image.php on line 54
Warning: fread(): supplied argument is not a valid stream resource in /usr/home/jongillies/domains/autooutlet.govital.net/public_html/testing/image.php on line 54
Upload an image to a database
Here's the latest picture
There is no image in the database yet

no database image available
Please upload a new picture and title
By Graham Ellis - graham@wellho.net
Note that this is a fully working example that you can try
out on our server using the link above. For security
reasons, we have changed the logins above but it works
exactly as it's displayed above on our test systems. As
you'll appreciate, various measures are taken with the
online example (and those measures may change from time to
time) to ensure the security and acceptability of content
posting and this security may include changes that prevent
posting and / or monitor your activity. See our privacy and
copyright statement that's available as a link in the footer
of this page.
TIPS IF YOU'RE INSTALLING THIS CODE YOURSELF
By its very nature, this script pulls together a whole raft
of technologies which may or may not be installed /
configure on your server ... if you have a shared hosting
service, it may not work if facilities are missing or are
not configured to a minimum level.
Firstly, you need to have installed on your server and
available to you:
a) MySQL - a recent 3.23 release, or MySQL 4 or MySQL 5
(configured to allow you to create tables)
b) PHP - version 4.1 or later with file upload enabled
(if file upload is not enabled, it cannot work)
c) the mysql_ set of mysql interfacing routines
(this program version does NOT use the mysqli versions)
Secondly, you need to change the mysql_connect function call
line to reflect the name of the database server you're using
if it's a different machine, and the login account name and
password that you use to access the database.
Thirdly, you need to change the mysql_select_db parameter to
reflect the name of the database that you're using - one in
which you have CREATE_PRIV.
If these facilities are not offered by your hosting service,
then you won't be able to run my script or any other script
that uses PHP and MySQL to upload images to a database.
Please post on our Opentalk forum if you're not sure or want
assistance - happy to help. Alas, I CANNOT help anonymous
users of this page who tell me that the scriot doesn't work
for them via the "rank and review" button ... their problem
is probably one of the configuration issues listed above but
I've no way of telling them :-/