PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.
Hello everyone,
I am have problem executing an output for an array from a database. I was succesful in unputting and serialize the data, however I am trying now for the longest while to unserialize the output, but without success. here is the code below, and the output is: Arraya:2:{i:0;sa:3:{i:0;sa:3:{i:0;sN;N;N;N;N;N;N;N;N;N;N;
<?
include ("Conn.php");
$query = "select * from Exhibitors";
$result=mysql_query($query);
$num=mysql_num_rows($result);
$i=0;
while ($i< $num){
$output1 =mysql_result($result,$i,"Exh_Type");
echo ($output1);
$i++;
}
?>
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.
Thanks,
I tried using the serialize function, but do not know where exactly to tailored it into my codes. Can anyone, look at my code snippets and see where/how to use the unserialize function?
Guys, I am really taking some blow on this , the unserialize is not working. I really need some help.
Just to recap quickly, I have inserted by checkbox serialized data, now I am trying to output by echo the data. But these codes are now working, as you will see in the codes below I am trying to get unserialize output in anyway possible:
Note:
(1)The table name as you can see from code is : Exhibitors
(2)The field name is: Exh_Type
(3)The checkbox input name= box[], and
(4)this is what shows up in the database: 23Arraya:2:{i:0;sa:3:{i:0;sa:3:{i:0;sN;N;N;N;N;N;N;N;N;N;N;N;N;N;
<?
include ("Conn.php");
$query = "select * from Exhibitors";
$result=mysql_query($query);