Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/245835-moved-from-windows-to-mac-cant-connect/
Share on other sites

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

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.