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?
How do I bring a mediumblob into php?
Moderator: General Moderators
-
Nathan Brignall
- Forum Newbie
- Posts: 2
- Joined: Fri May 16, 2008 1:57 pm
Re: How do I bring a mediumblob into php?
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?
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.
-
Nathan Brignall
- Forum Newbie
- Posts: 2
- Joined: Fri May 16, 2008 1:57 pm
Re: How do I bring a mediumblob into php?
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);
?>
<?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);
?>