contraboybish Posted August 27, 2011 Share Posted August 27, 2011 I will try and make this as simple as possible I used to run my site on a windows laptop using php & access database. Have now moved to a macbook pro and setup mamp which is running php fine but l cant connect to the database. This is the code i used in windows.... I know that 'logisticsnew' was set in windows to link to logistics.mdb universally but how do l set this in mac?? odbc_open.php <?php $odbc = odbc_connect ('logisticsnew', 'root', '') or die('Could Not Connect to ODBC Database!'); ?> index.php <img src="../images/latestnews.jpg" style="width:323px; height:23px" > <br /> <table> <?php require_once('../App_Data/odbc_open.php'); $query = odbc_exec($odbc, "SELECT * FROM search WHERE sHeadline='yes' ORDER BY nUrl DESC") or die (odbc_errormsg()); while($row = odbc_fetch_array($query)) { echo '<tr style="text-align:justify">'; echo '<td valign="top">'; echo '<img src="../'.$row['sImages'].' " width="'.$row['sImageWidth'].'" height="'.$row['sImageHeight'].'" alt="'.$row['sAlt'].'"hspace="8" vspace="8" align="right"/>'; echo '<div class="latestnews"><a href="news.php?sid='.$row['sId'].'" class="smallLinks" > '.$row['sHeading'].'</a><br /></div>'; echo '<div class="style2" style="text-align:justify">'.$row['sDescription'].'<br /></div>'; echo '<div class="smalldate">Date: '.$row['sDate'].'</div>'; echo '<br />'; echo '</td>'; echo '</tr>'; } odbc_close($odbc); ?> </table> It doesnt seem to be connecting to the database, l dont even get an error messsage??? Please forgive me as i am a complete novice at mac :-) Quote Link to comment https://forums.phpfreaks.com/topic/245835-moved-from-windows-to-mac-cant-connect/ Share on other sites More sharing options...
gizmola Posted August 29, 2011 Share Posted August 29, 2011 That is going to be one neat trick, considering that the Mac does not support Access. There is a commercial ODBC driver that advertises "read only" access to access db's. http://www.actualtech.com/product_access.php Quote Link to comment https://forums.phpfreaks.com/topic/245835-moved-from-windows-to-mac-cant-connect/#findComment-1263078 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.