Jump to content

seralize help just a quick question.


Demonic

Recommended Posts

Alright say I have this poll right, and I make it so it saves who votes.

 

 

so when a user votes. I want to update the array

 

$users = mysql_query("SELECT username FROM poll WHERE battle_id='1'");

$users = mysql_fetch_array($users);

$userz = unseralize($users[username]);

 

then would me using array_push() work im not sure atm.

 

$userz = array_push($userz,$logged[username]);

$newuser = seralize($userz);

 

then update the sql

 

$update = mysql_query("UPDATE poll SET username='$newuser' WHERE battle_id='1' ");

 

$logged[username] for example would be the loggedin username

 

would this work out i've never made a poll script yet but im going to give it a go I just want to know If im heading in the correct direction with this.

 

Link to comment
https://forums.phpfreaks.com/topic/38041-seralize-help-just-a-quick-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.