|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-08-17 14:16 UTC] trendboy at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 17:00:02 2025 UTC |
Description: ------------ Steps to reproduce: 1) Create a page to read in a JPEG image from a URL location and inserts into the database to a BLOB. 2) On another page select * from your blob 3) Using any method, myself_fetch_array or assoc get the contents 4) Print or echo it out You get Resource ID #5 Dump the vars from the result record set and you get resource 3 type(mysql result) It's very strange! It should be displaying the content of the blob to the screen and with the correct mime header set to jpeg it should show you the image. I thought maybe it was a bug on the LINUX version so I installed the windows version and same issue. Linux version: /usr/local/php/bin/php --version PHP 5.2.4 (cli) (built: Sep 17 2007 22:46:56) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies mysql --version mysql Ver 14.12 Distrib 5.0.27, for pc-linux-gnu (i686) using readline 5.0 I tried 5.2.6 on windows. It's a right head-wrecker :) Is it a bug? Reproduce code: --------------- The code (shortened of course) my insert is (after I get it from a URL etc): mysql_query("insert into thumbnail (image) values ('" . addslashes($img) . "')"); then to read it: $sql = "select * from thumbnail where id = 1"; $result = mysql_query($sql); var_dump($result); while ($row = mysql_fetch_assoc($result)){ echo $row[image]; } Expected result: ---------------- You should see your image