Problem with inserting BLOB into mysql DB
Posted: Fri Jan 16, 2009 3:53 pm
Here is the snipet of code from the script. The echo on line 3 goes through, so i know the imgdata variable is defined, however it will not insert it into the database.
If I change it around to be the following, it does the insert however, but obviously only with the word test.
Any ideas? Thanks guys
Code: Select all
$imgurl="http://www.wowarmory.com/wow-icons/_images/43x43/inv_helmet_134.png";
$imgdata=open_page($imgurl,1,2,0,0,0,$postcontent);
echo $imgdata;
mysql_query("Insert into `items` (`icon`) VALUES('$imgdata')");
$findid=mysql_insert_id();
$Select_img=mysql_query("Select * from items where id='$findid'");
$img=mysql_fetch_array($Select_img);
echo "$img[icon]";Code: Select all
$imgurl="http://www.wowarmory.com/wow-icons/_images/43x43/inv_helmet_134.png";
$imgdata="test";
mysql_query("Insert into `items` (`icon`) VALUES('$imgdata')");
$findid=mysql_insert_id();
$Select_img=mysql_query("Select * from items where id='$findid'");
$img=mysql_fetch_array($Select_img);
echo "$img[icon]";