: This article mainly introduces the PHP database operation mysqli. if you are interested in the PHP Tutorial, please refer to it. Database link
$ Server = "127.0.0.1"; $ username = "username"; $ pass = "password"; $ con = new mysqli ($ server, $ username, $ pass [, $ db_name]); // create a database link. if $ db_name is followed to create a link to the database $ db_name, create a link to the server. you can use $ con-> select_db ($ db_name); to select a data table.
Create a database
Try {$ con-> query ($ create_db);} catch (exception $ e) {}$ con-> select_db ("nwpu "); /// use try to avoid repeated database creation errors,
Create a data table
$ Table = "createtable name (". "firstvarchar (20) PRIMARYKEY ,". "sec VARCHAR (20 )". ")"; $ con-> query ($ table); // Use query to execute an SQL statement
Close database
$con -> close();
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above introduces the PHP database operation mysqli, including the content, hope to be helpful to friends who are interested in the PHP Tutorial.