We often need to make multiple choices for users, such as allowing users to select multiple items in the list and delete the selected items. Today, we will give an example to illustrate how php (as the mainstream development language) and JavaScript handle multiple choices. Today we are working on a voting system to vote for items in the itemtable table of the MySQL (best combination with PHP) database, and each individual IP Address can only vote for two votes.
The itemtable is created using the following MySQL (best combination with PHP) Statement:
Create table 'itemtable '(
'Id' TINYINT (4) not null AUTO_INCREMENT,
'Name' VARCHAR (50) not null,
'Votes 'SMALLINT (6) not null,
Prima (the most comprehensive VM management system) ry key ('id ')
);
The field "name" is the name of the list project, and "votes" is the number of votes. We also need to create a table "voteiptable" to record the IP address of the voting User:
Create table 'voteiptable '(
'Id' SMALLINT (6) not null,
'Voteip' VARCHAR (15) not null,
Prima (the most comprehensive VM management system) ry key ('id ')
);
Next we will compile the file "multivote. php (as the mainstream development language)". Today we will use a database file "dbclass. php (as the mainstream development language )".
We can find that the client's JavaScript and the server's php (as the current mainstream development language) have many similarities and differences in processing multiple choices. This is a classic multi-option processing program, which is simpler if user options are not limited.