Jump to content

update?


2wasted

Recommended Posts

lo all,
i have put a vote yes/no on a guestbook that submits with the other info name,email,comment.it works ok,but could i use "update" or something like that so it adds in the database?
this is what i have done...
[!--coloro:#006600--][span style=\"color:#006600\"][!--/coloro--] $name = $_POST["txt_name"];
$len = strlen($name);
if ($len > 0)
{ $email = $_POST["txt_email"];
$comment = $_POST["txt_comment"];
$date = time();
$yvote = $_POST["ybutton"];
$nvote = $_POST["nbutton"];
if ($ybutton == true)
{
$yvote++;
}
else
{
$nvote++;
}
$query = "INSERT INTO guestbook (autoID, name, email, comment, date_auto, yvote, nvote) VALUES (NULL, '$name', '$email', '$comment', '$date', '$yvote', '$nvote')";[!--colorc--][/span][!--/colorc--]
Thx for any help:-)
Charlie
Link to comment
https://forums.phpfreaks.com/topic/11819-update/
Share on other sites

thx for the reply,what i would like is for the votes to be added up in the database.atm it looks like this in the DB,
Name,email,comment(memo),yvote1,novote 0<<submit 1
Name,email,comment(memo),yvote1,novote 0<<submit 2
i would like..
Name,email,comment(memo),yvote2,novote 0<<submit 2 the yvote adding atm its just telling me what there vote was.
yvote=yes
nvote=no
Thx
Charlie
Link to comment
https://forums.phpfreaks.com/topic/11819-update/#findComment-44814
Share on other sites

[!--quoteo(post=383104:date=Jun 13 2006, 12:38 AM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Jun 13 2006, 12:38 AM) [snapback]383104[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Do you mean you added a vote system to an existing database/code and you need an update
query to get the votes in if a existing user votes.
[/quote]
soz for not explaining it properly,but yeah when they vote it goes into the DB but i would like the number to update:-)
Thx
Charlie
Link to comment
https://forums.phpfreaks.com/topic/11819-update/#findComment-44988
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.