Simple voting system instance implemented by PHP + MySQL, mysql voting system. Simple voting system example implemented by PHP + MySQL. mysql voting system this article describes the simple voting system implemented by PHP + MySQL. For your reference, we will share with you the simple voting system instance implemented by htmlhead PHP + MySQL and the mysql voting system.
This article describes the simple voting system implemented by PHP + MySQL. 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);?>