1

I have described the problem below:

My PHP code:

<?
        $conn = odbc_connect("DSN1","","");
        $sql = "SELECT * from PLAYER";
        $rs  = odbc_exec($conn, $sql);
        
        if($rs) {
            echo "you have successfully connected php to ms access";
            echo "<table style='color: white; background-color:yellow; border:5px solid'>";
            
            while(odbc_fetch_row($rs) ) {
                
                echo "<tr style='background-color:green; border:2px solid'>";
                echo "<td>"; echo odbc_result($rs,2);   echo "</td>";               
                echo "<td>"; echo odbc_result($rs,3);   echo "</td>";               
                echo "<td>"; echo odbc_result($rs,4);   echo "</td>";               
                echo "<td>"; echo odbc_result($rs,5);   echo "</td>";               
                echo "</tr>";
            }
            echo "</table>";
        }
        else {
            echo "you request for connection from php to ms access is unsuccessful";
        }

        ?>

My Access Database:

enter image description here

DSN:

enter image description here

Even after creating the dsn, I cant get the output.

Output:

enter image description here

Can anyone help?

Anthony
  • 335
  • 3
  • 8
  • `` should be ` – Dharman Jul 04 '20 at 19:56
  • Does this answer your question? [PHP code is not being executed, instead code shows on the page](https://stackoverflow.com/questions/5121495/php-code-is-not-being-executed-instead-code-shows-on-the-page) – Dharman Jul 04 '20 at 19:56

0 Answers0