Simple voting system instance implemented by PHP + MySQL

Source: Internet
Author: User
This article mainly introduces the simple voting system implemented by PHP + MySQL, and analyzes the code and related skills of PHP + MySQL in the form of a complete example, for more information about the simple voting system implemented by PHP + MySQL, see the example in this article. We will share this with you for your reference. The details are as follows:

Mobile Phone System questionnaireWhat is your current mobile phone system? Current number of votes:
<? Phpinclude 'connect. php '; $ SQL = "select answer from countone"; $ rs = mysql_query ($ SQL); $ total = mysql_num_rows ($ rs ); $ SQL = "select * from countone where answer = 1"; $ rs = mysql_query ($ SQL); $ android = mysql_num_rows ($ rs ); $ SQL = "select * from countone where answer = 2"; $ rs = mysql_query ($ SQL); $ symbian = mysql_num_rows ($ rs ); $ SQL = "select * from countone where answer = 3"; $ rs = mysql_query ($ SQL); $ iphone = mysql_num_rows ($ rs); $ SQL = "Select * from countone where answer = 4"; $ rs = mysql_query ($ SQL); $ google = mysql_num_rows ($ rs ); $ SQL = "select * from countone where answer = 5"; $ rs = mysql_query ($ SQL); $ winphone = mysql_num_rows ($ rs ); $ SQL = "select * from countone where answer = 6"; $ rs = mysql_query ($ SQL); $ other = mysql_num_rows ($ rs);?>
Android Symbian Iphone Google Winphone Other
<? Php echo $ android?> Ticket <? Php echo $ symbian?> Ticket <? Php echo $ iphone?> Ticket <? Php echo $ google?> Ticket <? Php echo $ winphone?> Ticket <? Php echo $ other?> Ticket
<? Php for ($ I = 1; $ I <= $ android/$ total + 1; $ I = $ I + 0.1) {echo"

";}?>
<? Php for ($ I = 1; $ I <= $ symbian/$ total + 1; $ I = $ I + 0.1) {echo"

";}?>
<? Php for ($ I = 1; $ I <= $ iphone/$ total + 1; $ I = $ I + 0.1) {echo"

";}?>
<? Php for ($ I = 1; $ I <= $ google/$ total + 1; $ I = $ I + 0.1) {echo"

";}?>
<? Php for ($ I = 1; $ I <= $ winphone/$ total + 1; $ I = $ I + 0.1) {echo"

";}?>
<? Php for ($ I = 1; $ I <= $ other/$ total + 1; $ I = $ I + 0.1) {echo"

";}?>

It's a bit cool, stupid, but practical.

<? Phpinclude 'connect. php '; $ name = $ _ POST ['phone']; $ SQL = "insert into countone values (null, $ name, now (), null )"; mysql_query ($ SQL);?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.