note 36458 added to function.mysql-fetch-row
| From: | scovron at rn2 dot php dot net | Date: | Fri, 10 Oct 2003 07:23:13 +0000 |
| Subject: | note 36458 added to function.mysql-fetch-row | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-58179@lists.php.net to get a copy of this message | ||
Is mysql_fetch_row doing 'stripslashes' automaticly, when geting data from BLOB fields?
Well, that's my story:
I was adding picture, which name was stored in variable $nazwa_pliku:
$data = addslashes(fread(fopen($nazwa_pliku, "r"), filesize($nazwa_pliku)));
$wynik = mysql_query("UPDATE Uzytkownik SET Zdjecie='".$data."' WHERE
Login='".$_POST['Login']."';");
where 'Zdjecie' is mediumblob field.
Then I was trying to retrive this picture from MySQL like this:
header("Content-type: image/jpeg");
$photo = stripslashes(picture_get("Select Zdjecie From Uzytkownik Where
Login='".$_GET['Login']."';")); //picture_get retrives picture
from DB
header("Content-Length: ".strlen($photo));
echo $photo;
and the picture was messed up (it's size was diffrent, than original). But when I didn't
use stripslashes function, it was ok.
----
Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-row.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36458
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36458&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36458&report=yes
Search -- http://master.php.net/manage/user-notes.php