Many Thanks.
It is working now.The problem is before the sql statement i did the following.
I think before issuing the query i should serialize the value.
$category=array("testval1","testval2","testval3");
$category=addslashes(serialize($category));
Then the update query.
But while retrieving i tried like this to get the $category value.
$stmt=mysql_db_query("database","select category from test where id='$id'");
list($val)=mysql_fetch_row($stmt);
$val=unserialize($val);
while(list($key)=each($val))
{
print("my value ".$key."<br>");
}
For that i am getting the result as
my value 0
my value 1
my value 2
But i am getting the exact values if i do it like this.
for($i=0;$i<sizeof($val);$i++)
{
print("my value ".$val[$i]."<br>");
}
The printed results are
my value testval1
my value testval2
my value testval3
I don't know what is the exact problem when i use while(list()=each()).
If you have any answer for this it will be very much useful for me.
Thanks
srini