|
This snippet defines a variable ($db) containing the connection string for the PHP mysql_pconnect function and executes the connection function.
If the database cannot be reached, the 'if' statement returns an error message. Otherwise, a persistent connection is established. Using 'mysql_pconnect' rather than the alternative
'mysql_connect' can improve performance on a busy server.
Actually connecting to the appropriate database on the server comes next.
|