Jump to content


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


Please Help Simpe Q: Passing Button Info to DB

Recommended Posts

Hi ya all,

im a total newbiew :ph34r: so please do try to help; i'm trying to do a simple online questionaire. Basically there is a question and two choices, with 'yes' or 'no', and now I need my survey to be able to count the number of 'yes' or 'no' that people have voted. So i have a simple mysql table with the question and the two choice (i will have more choices 1ce i get these working). The 'yes' or 'no' option should either be radio or check buttons, which i'm doing in dreameweaver in a form. How can i get record the numbe of votes for each options? is it a count function in php or incremento-both of which i do not kno whow to do.


please provide a simple working e,g and once the votes/survey has taken place the results should be displayed? please help


if you know it in any otehr methods please give a working e.g


thanks in advance :)

Share this post

Link to post
Share on other sites

Where are two ways I have used to count records

$result1 = mysql_query ("Select fldnm from tblnm where fldnm = '$Value' ");
$num1 = mysql_num_rows($result1);


$result=mysql_query("select count(*) from tblnm where fldnm = '$value'"); 


Hope this helps a little.

Share this post

Link to post
Share on other sites

if you have a field in a table your are going to compair the 'VALUE' of whats in that field. The 'VALUE' is the query is what your searching for.


If the field options are 'YES' or 'NO'


then the value with be what your looking for to count.


If you have a checkbox field in general the values with be 0 or 1

Share this post

Link to post
Share on other sites


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.