PHP & MS access

Can anyone point me to a PHP3 example program that uses MS access or any generic ODBC drivers?
moshezAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
shawonConnect With a Mentor Commented:
The folowing example uses MS SQL Server
Access is most same
<?
if($passwd == "" || $userid == ""){
      Header("HTTP/1.0 401 Unauthorized");
      echo "user ID or password is empty";
      exit;
}else{
      
      $conn=mssql_connect("SHAW","" ,"" );
      if (!$conn)      {
            echo "Connect to database failed\n";
            exit;
            }
      $selectdb=mssql_select_db("music", $conn);
      $query = "Select * from users where user_ID='$userid' and passwd='$passwd'";
      $select = mssql_query($query,$conn);
      $rows = mssql_num_rows($select);
      if($rows < 1){
            $message="That username is invalid... Please try again, or use the Send Password button.<br>\n";
            $login="False";
      }
      else {
            $login="True";
            $message = "Login successfuly";
      }
      echo $message;
}

?>
0
 
moshezAuthor Commented:
Thanks Shawon

odbc driver is working a little different but this example simplifies things compared to MySQL examples.

Moshe
0
All Courses

From novice to tech pro — start learning today.