Jump to content

Recommended Posts

my code is:

$result = mysql_query("SELECT * FROM calendar where num = ".$_GET['num']);
$row = mysql_fetch_array($result);
.
.
.
echo "<BR><BR>Description:<BR>'".$row['description']."'";

I'm sure it's getting the correct row, because it's displaying other data from it, but it won't display anything from the description filed(which is a blob data type).
Link to comment
https://forums.phpfreaks.com/topic/23113-blob/#findComment-104574
Share on other sites

there's a simple rule I personally follow myself regarding PHP/MySQL. If you don't know what something is, you either don't need it or should look it up in the manual if you're curious. (I don't mean that in a dismissive way either  :) ).

There are so many different field types in MySQL that cater for all sorts. Me personally, i've only probably used about 6 or 7 different ones ever (less if you dont consider the variants - SMALLINT, INT, BIGINT, etc). Some of the others I will probably never have a use for.

Getting data from a blob field is no different really from any other field in terms of getting data from it. A normal SELECT will suffice. Whilst I can't honestly say I know exactly the full/proper use for the blob field, i've always used it to store binary data. Anything that is generally entered via a <form> can be put in the basic types - VARCHAR (or CHAR), INT (or its smaller/larger variants), TEXT, etc. a textarea would be suited to putting data into a TEXT field, not a BLOB.

hope that makes sense
cheers
Mark
Link to comment
https://forums.phpfreaks.com/topic/23113-blob/#findComment-104575
Share on other sites

[quote author=mbvo link=topic=110623.msg447539#msg447539 date=1160083675]
perfectly, and after posting I've been looking around more on google and playing with my code, and i got it to display all but the first line using a varchar field, and changing it to nl2br($row['description']).  But now my question is why is it now displaying the first line?
[/quote]

I feel stupid now, I just looked at the source code for the page and the browser is interperting it wrong was my problem.
Link to comment
https://forums.phpfreaks.com/topic/23113-blob/#findComment-104593
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.