Jump to content

PHP, Ajax, MySQL poll


colombian

Recommended Posts

I was looking around online to see examples of polls that combine these 3 techniques. But I didn't find anything that really worked well.

 

Any suggestion on some? Or code help to get it rolling.

 

I can do it in PHP/MySQL fine, but I want to add Ajax, and I am having trouble making the submit part of the form activate the ajax needed to refresh it.

 

<form action="PHP/JavaScriptPathCode" method="post">
				<?  while( $row = mysql_fetch_array($query) ) //Begin a loop to echo out each option
				  { ?>
					 <label><input type="radio" name="web_poll" value="<?= $row['option'] ?>" /> <?= $row['option'] ?></label><br />
				  <? } 
				  echo '<input name="" type="submit" /></form>';

 

The table consists of 3 pieces of data.

ID, option, and counter

 

I would like it that when the user submits the form, it will update the counter of the particular selection in the database, as well as refreshing that small area to display the results.

 

Any help or pointers would be greatly appreciated.

 

thanks.

 

Link to comment
Share on other sites

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.