[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

Looking for Documentation On PHP and ODBC

I am new to PHP but I get it.  I am trying to connect to an Access DB via ODBC and have mostly been successful, but the debugging process is painful because I can't seem to find any documentation to explain some of the errors I encounter, for example "Resource ID #7".  What does that mean?  Can somebody point me toward a reference that explains these "resource ids" and the like?

Mike
0
shacho
Asked:
shacho
  • 2
1 Solution
 
shachoAuthor Commented:
I should add that I realize that "Resource ID ???" may not be an error but a datatype - still I can't seem to find any references.
0
 
edster9999Commented:
Your right it is not an error but a pointer to your open connection.

(example text taken from
http://www.w3schools.com/PHP/php_db_odbc.asp )

$conn=odbc_connect('northwind','','');
$sql="SELECT * FROM customers";
$rs=odbc_exec($conn,$sql);

At this point rs is a resource.  I assume you are trying to do echo "$rs" or something similar.

First you need to pull up a row :

odbc_fetch_row($rs)

Then take the data out of a field inside that row (or record) :

$compname=odbc_result($rs,"CompanyName");
echo "$compname";


0
 
Loganathan NatarajanLAMP DeveloperCommented:
0
 
shachoAuthor Commented:
Thanks!

Mike
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now