Jump to content

Unserializing data


bullbreed

Recommended Posts

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
Share on other sites

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.  :wtf:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.