2wasted Posted June 9, 2006 Share Posted June 9, 2006 lo all,i have made a simple guestbook but i was wondering if i could put a simple yes/no vote on it?can i just insert a new row on my guestbook table[mysql] then put the yes/no into the DB from radio buttons in the form?Thx for any help:-)Charlie Quote Link to comment https://forums.phpfreaks.com/topic/11624-newbie-vote-q/ Share on other sites More sharing options...
legohead6 Posted June 10, 2006 Share Posted June 10, 2006 do you want it to be there all the time? or do you want the signer of the questbook to choose if he wants it and what the questions are?(like a forum) I dont really get what you want please explain more! Quote Link to comment https://forums.phpfreaks.com/topic/11624-newbie-vote-q/#findComment-43909 Share on other sites More sharing options...
2wasted Posted June 10, 2006 Author Share Posted June 10, 2006 my guestbook is Name Email Comment,i would like to put into the form a yes/no radio buttons or drop down that i can keep in the DB.maybe to put in a graphic display l8ter when i learn how:-)i just want 2 know if it was hard..thx for the replyCharlie Quote Link to comment https://forums.phpfreaks.com/topic/11624-newbie-vote-q/#findComment-43916 Share on other sites More sharing options...
legohead6 Posted June 10, 2006 Share Posted June 10, 2006 [!--quoteo(post=382134:date=Jun 9 2006, 09:38 PM:name=2wasted)--][div class=\'quotetop\']QUOTE(2wasted @ Jun 9 2006, 09:38 PM) [snapback]382134[/snapback][/div][div class=\'quotemain\'][!--quotec--]my guestbook is Name Email Comment,i would like to put into the form a yes/no radio buttons or drop down that i can keep in the DB.maybe to put in a graphic display l8ter when i learn how:-)i just want 2 know if it was hard..thx for the replyCharlie[/quote]if your using radios just name them the same. the no one make its value 0 and the yes one 1 then go like thisif($_POST['[i]name[/i]'] == 0){$var="No";}else{$var="yes";}then just post $var to the database... or post the number to the database then retrieve and do the code above later! Quote Link to comment https://forums.phpfreaks.com/topic/11624-newbie-vote-q/#findComment-43921 Share on other sites More sharing options...
2wasted Posted June 10, 2006 Author Share Posted June 10, 2006 [!--quoteo(post=382140:date=Jun 9 2006, 11:29 PM:name=legohead6)--][div class=\'quotetop\']QUOTE(legohead6 @ Jun 9 2006, 11:29 PM) [snapback]382140[/snapback][/div][div class=\'quotemain\'][!--quotec--]if your using radios just name them the same. the no one make its value 0 and the yes one 1 then go like thisif($_POST['[i]name[/i]'] == 0){$var="No";}else{$var="yes";}then just post $var to the database... or post the number to the database then retrieve and do the code above later![/quote]cheers:-)i'll give that a go,can i insert the new row in mysql or do i just do the db table again and put in the new row?thxCharlie Quote Link to comment https://forums.phpfreaks.com/topic/11624-newbie-vote-q/#findComment-44066 Share on other sites More sharing options...
joquius Posted June 10, 2006 Share Posted June 10, 2006 just choose do add a new row, considering you are using an INT field it will automatically set all fields to a negative result of 0 if u do not set the default to 1 (given there are already entries in the book) Quote Link to comment https://forums.phpfreaks.com/topic/11624-newbie-vote-q/#findComment-44070 Share on other sites More sharing options...
2wasted Posted June 10, 2006 Author Share Posted June 10, 2006 [!--quoteo(post=382292:date=Jun 10 2006, 01:58 PM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 10 2006, 01:58 PM) [snapback]382292[/snapback][/div][div class=\'quotemain\'][!--quotec--]just choose do add a new row, considering you are using an INT field it will automatically set all fields to a negative result of 0 if u do not set the default to 1 (given there are already entries in the book)[/quote]thx all,Charlie Quote Link to comment https://forums.phpfreaks.com/topic/11624-newbie-vote-q/#findComment-44112 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.