Phpsql statements are described in detail later. The latest php will help you learn more.
The code is as follows:
@ Mysql_connect ("localhost", "root", "1981427") // you must connect to the database server before selecting a database.
Or die ("database server connection failed ");
@ Mysql_select_db ("test") // select the database mydb
Or die ("The database does not exist or is unavailable ");
$ Query = @ mysql_query ("select * from tablename1") // execute an SQL statement
Or die ("SQL statement execution failed ");
?>
The code is as follows:
@ Mysql_connect ("localhost", "root", "1981427") // you must connect to the database server before selecting a database.
Or die ("database server connection failed ");
@ Mysql_select_db ("test") // select the database mydb
Or die ("The database does not exist or is unavailable ");
$ Query = @ mysql_query ("insert into tablename1 values ('4', 'Judy ', '123 ')")
Or die ("SQL statement execution failed ");
?>
The code is as follows:
@ Mysql_connect ("localhost", "root", "1981427") // you must connect to the database server before selecting a database.
Or die ("database server connection failed ");
@ Mysql_select_db ("test") // select the database mydb
Or die ("The database does not exist or is unavailable ");
$ Query = @ mysql_query ("select * from tablename1") // execute an SQL statement
Or die ("SQL statement execution failed ");
Echo mysql_result ($ query, 0, 'Username'); // output the name column of row 0th
?>