explode / implode function call on a field with blob type
| From: | Shahmat Dahlan | Date: | Thu, 04 Aug 2005 08:56:18 +0000 |
| Subject: | explode / implode function call on a field with blob type | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-40029@lists.php.net to get a copy of this message | ||
I have the following table structure called announcements
- id int(6)
- data longblob
And this is what i did:
$sql_stmt = "SELECT id, data FROM announcements";
$query = mysql_query ($sql_stmt);
while ($row = mysql_fetch_object ($query)) {
echo $row->id;
$tmp = explode (" ", $row->data, 10); #1
$data_stripped = implode (" ", $tmp); #2
echo $row->data;
}
#1 the reason why I had used explode with " " (space character) as the delimeter with the limit set to 10 is because I want to extract only the first 10 words out of the "data".
#2 and string those 10 words into a string and display them out
instead of getting the intended results (the first 10 words), i get "1111111"
is this because my "data" field type is longblob or blog?
regards