Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

Get array value from DB, problem

Links for php scripts

Moderators: macek, egami, gesf

Get array value from DB, problem

Postby kiwi » Mon Sep 27, 2004 10:52 am

i use serialize() to convert an array and then store in a field called 'parts' in table name 'custom', when i retrieve the value from db, i get back the value and i use unserialize(), to convert back, when i view back the variable, it is nothing, it doesnt work, how? any problem? thanks

$conn = @mysql_pconnect("localhost", "tan", "");
$sql = "select * from custom where CustomID = '$ID'";
$result = mysql_query($sql, $conn);
$qry = mysql_fetch_array($result);

$custom= $qry[parts];
echo $custom;
$custom = unserialize($custom);
echo $custom;
kiwi
New php-forum User
New php-forum User
 
Posts: 124
Joined: Sun Feb 29, 2004 6:26 am

Postby swirlee » Mon Sep 27, 2004 11:26 am

kiwi,

Don't start a new topic for an old question.

Locked.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron