Config ("dns=aaa;uid=sa;pwd=sa;dbname=test");//3. Select Database $dbname = $db->select_db ("test"),//4. Set Allow Debug $db->debug = TRUE;//5. Executes a SQL statement that does not return a result $db->execute ("INSERT into test01 (name) values (' This is a test! ')"); /$db->exec ("");//6. Executes a SQL statement that returns a result $rs = $db->query ("SELECT * from test01"),//7. Display results as row echo "
Display result set in row mode
while ($r = $db->fetch_row ($rs)) {echo $r [0]. ":". $r [1]. "
";} 8. Display the result in array mode $rs2 = $db->query ("SELECT * from test01"); echo "
Display result set in array mode
while ($r = $db->fetch_array ($rs 2)) {echo $r ["id"]. ":". $r ["Name"]. "
";} X. Release $db->db_close ();? >
The above describes the PHP database call class invocation instance, including the database, PHP content, I hope that the PHP tutorial interested in a friend helpful.