This article mainly introduces the implementation process of PHP + Mysql + jQuery query and list box selection operations. if you need it, refer to this article to explain how to query mysql data through ajax, the returned data is displayed in the list to be selected, and then selected to add the option to the selected area, which can be used in many background management systems. The operations on the list box in this article depend on the jquery plug-in.
HTML
Description: The HTML content is a form containing a query input box, a list box, and related buttons.
MYSQL data table structure
CREATE TABLE IF NOT EXISTS `t_mult` ( `id` int(11) NOT NULL auto_increment, `username` varchar(32) NOT NULL, `phone` varchar(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Table t_mult is a contact data table, including the name and mobile phone number fields.
CSS
In this example, only the style files required by the Multiselect plug-in are loaded. you can design other CSS files by yourself.
JAVASCRIPT
First, you need to reference the two js files required in this example.