Forum Moderators: coopster
DSN-less (ADO) or ODBC may do, but it would be very helpful if it would very detailed. For example: if it needs to change or add something the INI file in of php.
Thanks for any light you could shed on this. :)
I'd appreciate any comments.
<?php /**** dbaccess.php ****/function open_db($hostname, $userid, $password, $db_name = -1)
{
if($db_channel = mysql_connect($hostname, $userid, $password))
{
if($db_name != -1)
{
if(mysql_select_db($db_name, $db_channel))
return $db_channel;
else
mysql_close($db_channel);
}
else {
return $db_channel;
}
}
else
return -1;
}
function close_db($host)
{
mysql_close($host);
}
?>
Edit: Sorry, I'm too used to [php][/php] from vBulletin...
PostEdit: OK, why isn't [ code ] working for me in preview mode(at least)???