Code for establishing a connection between php and mysql and executing SQL statements. Today I wrote a small program, which is very small. it is just capable of establishing links between php and mysql and implementing simple SQL statements. This is the first test for beginners. Today, the program source has written a small program, which is very small. it is only capable of establishing links between php and mysql and implementing simple SQL statements.
This is the first test for beginners.
The program source code is as follows:
The code is as follows:
$ Conn = mysql_connect ("localhost", "root", "") or die ("wrong! ");
$ Sel = mysql_select_db ("mydb", $ conn );
$ SQL = "INSERT INTO 'mydb'. 'test '(
'Id ',
'Uid ',
'Regdate ',
'Remark'
)
VALUES (
'', 'Php200', now (), 'ddddd'
)";
$ Que = mysql_query ($ SQL, $ conn );
If ($ que)
Echo "true ";
Else
Echo "wrong ";
?>
Bytes. This is the first test for beginners. Program source...