Jump to content


Photo

Please Help Simpe Q: Passing Button Info to DB


  • Please log in to reply
3 replies to this topic

#1 Dreamer

Dreamer
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 04 March 2004 - 05:17 PM

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

#2 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 04 March 2004 - 06:38 PM

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 understand everything you know nothing!

http://rcchjr.awardspace.com/

#3 Dreamer

Dreamer
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 04 March 2004 - 11:54 PM

hmmm i'm a newbiew dude, whats the value for?

#4 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 05 March 2004 - 01:10 PM

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
If you understand everything you know nothing!

http://rcchjr.awardspace.com/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users