Page 1 of 1

How do I bring a mediumblob into php?

Posted: Fri Aug 15, 2008 4:04 pm
by Nathan Brignall
Hey,

I have a mysql table with several fields in it. I'm not having any trouble with any of the varchar fields, but how to get the mediumblob field has really got me stumped. Does anyone know how to SELECT a mediumblob from a mysql table and bring it into php?

Re: How do I bring a mediumblob into php?

Posted: Fri Aug 15, 2008 5:58 pm
by idevlin
Why? Just perform a select and store it in a variable, it works fine for me? What exact trouble are you having?

Re: How do I bring a mediumblob into php?

Posted: Fri Aug 15, 2008 8:27 pm
by Jade
I'm not sure what sql you're using but I know microsoft sql has issues with blobs/texts. For those you need to select the blob/text at the end of the select statement otherwise it has issues. Dunno but maybe that'll help.

Re: How do I bring a mediumblob into php?

Posted: Sat Aug 16, 2008 11:30 am
by Nathan Brignall
I'm using it to store images. Thanks for the help. How would I get all my pictures to come onto the page? So far I only get the first image in the database.

<?php

$link = mysql_connect ("localhost", "mystuff", "mystuff");
mysql_select_db ("mystuff");

$result = mysql_query("SELECT mystuff FROM mystuff");
header("Content-type: image/jpeg");
echo mysql_result($result, 0);

?>