Please Help Simpe Q: Passing Button Info to DB
Posted 04 March 2004 - 05:17 PM
im a total newbiew 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
Posted 04 March 2004 - 06:38 PM
$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'"); $total=mysql_result($result,0,"count(*)");
Hope this helps a little.
Posted 05 March 2004 - 01:10 PM
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
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users