Jump to content

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 :)

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'"); 
$total=mysql_result($result,0,"count(*)");

 

Hope this helps a little.

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.