使用範例:
<?php
$link=mysql_pconnect("localhost","sunsoft","suixiang") or die("Could not connect");
mysql_select_db("samp_db") or die("Could not select database");
$query="INSERT INTO
member(last_name,first_name,expiration)"."VALUES('Brown','Marcia','2002-6-3')";
$result=mysql_query($query) or die("Query failed");
printf("%d row%s insertedn",mysql_affected_rows(),mysql_affected_rows()==1?" ":"s");
?>
(2) int mysql_close(int[link_id]);
關閉由link_id標識的與MySQL服務器的連接。如果沒有指定連接,則mysql_close()關閉最近打開的連