bullbreed Posted January 26, 2010 Share Posted January 26, 2010 I want to put the unserialized data into a table and came up with this; $sql = "SELECT `sec1`, `sec1other`, `sentdate` FROM `trainingdata` WHERE `username`='".$_GET['username']."'"; $sql_query = mysql_query($sql) or trigger_error(mysql_error()); if (mysql_num_rows($sql_query) > 0) { while ($data = mysql_fetch_assoc($sql_query)) { $sec1 = unserialize ($sec1['sec1']); ?> <tr> <td width="50%"><?php echo $data['sec1']; ?></td> <td><?php echo $data['sec1other']; ?></td> <td width="20%"><?php echo $data['sentdate']; ?></td> </tr> Doesn't work. Anyone any ideas. Link to comment https://forums.phpfreaks.com/topic/189911-unserializing-data/ Share on other sites More sharing options...
taquitosensei Posted January 26, 2010 Share Posted January 26, 2010 where does the $sec1 array come from? I don't see it in the code you posted. probably supposed to be $sec1 = unserialize ($data['sec1']); Link to comment https://forums.phpfreaks.com/topic/189911-unserializing-data/#findComment-1002095 Share on other sites More sharing options...
bullbreed Posted January 26, 2010 Author Share Posted January 26, 2010 This is somethiing I took from a tutorial and cant get it to work. I see what you mean about the variable. Thanks for that. $sec1 was the original variable I created for data from the initial form submission Any more reasons how I messed it up. Link to comment https://forums.phpfreaks.com/topic/189911-unserializing-data/#findComment-1002102 Share on other sites More sharing options...
KrisNz Posted January 27, 2010 Share Posted January 27, 2010 In what way does it not work? Is $data['sec1'] empty or does it not unserialize into whatever it was when you serialized it? Link to comment https://forums.phpfreaks.com/topic/189911-unserializing-data/#findComment-1002208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.