Welcome to WebmasterWorld Guest from 54.163.35.238

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP MS Access

php script to access db from ms access

     

copongcopong

4:25 am on Sep 9, 2002 (gmt 0)

10+ Year Member



Any one here know a tutorial that would help in configuring or creating a script in php that would access database created in MS Access?

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. :)

Slade

4:38 am on Sep 9, 2002 (gmt 0)

10+ Year Member



This is what I wrote originally(slightly upgraded since 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)???

 

Featured Threads

Hot Threads This Week

Hot Threads This Month