homer.favenir Posted September 9, 2007 Share Posted September 9, 2007 i have a database in ms access i want to use php to enter data. i set up my odbc in control panel. here is my code in php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $conn=odbc_connect ('yhentry','',''); if ($conn) { exit ("Connection Failed" . $conn); } $sql="Select * from YH Entry"; $rs=odbc_exec($conn,$sql); if (!$rs) { exit ("Error in SQL"); } echo "<table><tr>"; echo "<th>Directory Name</th>"; echo "<th>Filename</th>"; while (odbc_fetch_row($rs)) { $directory=odbc_result($rs,"Directory"); $filename=odbc_result ($rs,"Filename"); echo "<tr><td>$directory</td>"; echo "<td>$filename</td></tr>"; } odbc_close ($conn); echo "</table>"; ?> </body> </html> and my access is working... pls help me with my code. thanks ??? Link to comment https://forums.phpfreaks.com/topic/68531-problem-connecting-to-ms-access-from-php-pls-help-tnx/ Share on other sites More sharing options...
RichardRotterdam Posted September 28, 2007 Share Posted September 28, 2007 Hmmm using something great as php and combining it with something evil from microsucks what a sin using mySQL or postgresql is easier and better. You're code seems good have you setup the odbc connection correctly in your Administrative Tools. here is a link http://www.w3schools.com/php/php_db_odbc.asp Link to comment https://forums.phpfreaks.com/topic/68531-problem-connecting-to-ms-access-from-php-pls-help-tnx/#findComment-357124 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.