Jump to content


Photo

update?


  • Please log in to reply
4 replies to this topic

#1 2wasted

2wasted
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 12 June 2006 - 11:46 PM

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

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 13 June 2006 - 12:39 AM

What are the issues you are having?

INSERT should be fine to add entries to the database.
~ D Kuang

#3 2wasted

2wasted
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 13 June 2006 - 12:48 AM

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

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 13 June 2006 - 05:38 AM

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.



Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 2wasted

2wasted
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 13 June 2006 - 12:34 PM

[!--quoteo(post=383104:date=Jun 13 2006, 12:38 AM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Jun 13 2006, 12:38 AM) View Post[/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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users