Jump to content

Php - Access Db coding issue


vishwa008

Recommended Posts

Hi ;

Im getting the below error from Access database please help me to fix it.

 

[root@db_cesar home]# php test.php

table name :  t_b_Door

column name :  f_DoorID

t is not a table in this database

Error at Line : syntax error near _

PHP Warning:  odbc_exec(): SQL error: [unixODBC]Couldn't parse SQL , SQL state 08001 in SQLExecDirect in /home/test.php on line 15

 

 

This is my code

 

<?php

  $conn=odbc_connect("logindb","","");

  if (!$conn)

  {

    exit("Connection Failed: " . $conn);

  }

 

 

  $sql="SELECT f_ReaderID FROM t_b_Reader";

 

  $rs=odbc_exec($conn,$sql);

  if (!$rs)

  {

    exit("Error in SQL");

  }

  while (odbc_fetch_row($rs))

  {

    $f_ReaderID=odbc_result($rs,$f_ReaderID);

    //$conname=odbc_result($rs,"ContactName");

    echo "$f_ReaderID \n";

  }

  odbc_close($conn);

?>

 

Thanks

 

Link to comment
Share on other sites

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.