If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Convert BLOB to separate fields

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-29-08, 21:35
acctman acctman is offline
Registered User
 
Join Date: Aug 2008
Posts: 4
Convert BLOB to separate fields

PHP Code:
<?php
$dbc 
mysql_connect ($db_server$db_user$db_pass);
mysql_select_db ($db_name) or die(mysql_error());

$res mysql_query("SELECT m_addtn FROM rate_members WHERE m_id = '39'");
$results mysql_fetch_array($res,MYSQL_BOTH);

$decode unserialize(base64_decode($results['m_addtn']));
print_r($decode);
?>
here's what I still need to do, and maybe you can help me with an all sql coded version that I can process inside of phpmyadmin.

this is the output data from the above query
Array ( [3] => Single [6] => Involved [4] => I ADDED SOME NEW PICS [1] => THEY R IN THE MAIN 4 NOW )

I've created m_status, m_ori, m_turn1 and m_turn2 in the same table as m_addtn. What I want to do is create a loop that will go to each row and decode the m_addtn field then take the 4 arrays with data in them an insert into the fields. So Array[3] would insert into m_status, Array[6] into m_ori, Array[4] into m_turn1 and Array[1] into m_turn2

Can that be done with an all sql code or will i have to use php
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On