-
-
$con = mysql_connect("localhost","peter","abc123"); - if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
// some code
?>
-
Copy code
Close connect
Once the script ends, the connection is closed.
To close the connection early, use the mysql_close() function.
-
-
- $con = mysql_connect("localhost","peter","abc123");
- if (!$con)
- { bbs.it-home.org
- die('Could not connect: ' . mysql_error());
- }
// some code
mysql_close($con);
- ?>
-
Copy code
|