giants10
04-24-2008, 12:16 PM
can anyone please tell me if the following is a good code to connect to the database
<?php
function db_connect()
{
$result = mysql_pconnect('localhost', 'bm_user', 'password');
if (!$result)
return false;
if (!mysql_select_db('localhost'))
return false;
return $result;
}
is there anything i should add to the code?
<?php
function db_connect()
{
$result = mysql_pconnect('localhost', 'bm_user', 'password');
if (!$result)
return false;
if (!mysql_select_db('localhost'))
return false;
return $result;
}
is there anything i should add to the code?