<? Php <br/> // ensure that the PHP environment is created on the local machine and the database is created. "localhost" is the server address; "," root ", "" indicates the login username and password. "@" means blocking error. <br/> $ link = @ mysql_connect ("localhost", "root ",""); <br/> If (! $ Link) {die ("error") ;}< br/>/* The die () function means to send the strings in brackets to the browser and interrupt the PHP Program (SCRIPT ). The parameters in the brackets are the strings to be sent. */<Br/> // select the database named test on the server. <br/> $ db_selected = mysql_select_db ("test", $ link ); <br/> // print the data if the link is successful. <br/> if ($ db_selected) {<br/> echo "the database is selected successfully. "; <br/>}< br/>/* defines the variable q." select * from ABC "is an SQL statement, reads data from Table ABC */<br/> $ q = "select * from ABC"; <br/>?>