Get array value from DB, problem

Links for php scripts

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 124
Joined: Sun Feb 29, 2004 6:26 am

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;

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

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


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


Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest