Re: ODBC, PHP and a lack of understanding.
From: evilbreadbin (phil_at_openaccess.tv)
Date: 07/27/04
- Next message: Andrew: "prons with password scripts (newbie)"
- Previous message: Markus Ernst: "Re: Create a PHP Page Dynamically"
- In reply to: evilbreadbin: "ODBC, PHP and a lack of understanding."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Jul 2004 03:02:00 -0700
phil@openaccess.tv (evilbreadbin) wrote in message news:<a9ec01dd.0407260328.1ab97764@posting.google.com>...
> Greetings,
>
> My problem consists of two parts, the first of which I imagine is only
> a matter of syntax whilst the second might very well be impossible.
>
> I'm not sure if it is of consequence but PHP is running on a Win2000
> machine and the ODBC connection in question links to an MS-Access
> database.
>
> 1/ I am trying to get my head around odbc_columns(). When using the
> function in its simple case -- just providing a ODBC link -- all is
> fine and it returns a dataset of all the columns in all the tables
> fine. The problem is that I cannot ask it to list _all_ the columns
> each time and I would like to be able to inspect just one table's
> columns. (A major reason for this is that the target database
> contains hundreds of tables and so odbc_columns() takes a long time to
> complete.)
>
> Trouble is I don't posses enough knowledge of DB systems to understand
> what is meant by the qualifier and schema parameters, anyone had any
> success in this area?
>
> 2/ I grant that this doesn't seem to have a solution but I thought
> I'd ask just in case... basically I'm looking for an equivalent of
> mysql_field_table() but for ODBC. Either that or some way of
> determining the source table of a given field from a resultset or even
> the original SQL statement.
>
> Any help would be greatly appreciated.
>
> --Phil
For anybody having similar problems I have now managed to get the
first part of this working. Here is a working example:
<?php
$conn_ODBC = odbc_connect("peopledb", "Admin", "") or die;
$result = odbc_columns($conn_ODBC, "peopledb", "", "people");
odbc_result_all($result);
?>
Where the second param of odbc_columns() is the DNS ODBC link, the
third a zero length string and the forth the table name.
Still don't have a solution to the second part, I'm thinking of doing
a simplistic SQL parser to pull the information directly from the SQL
Statement -- clearly not a preferred solution but it is the only one I
see. Therefore I'd be grateful for any other advice on the matter.
--Phil
- Next message: Andrew: "prons with password scripts (newbie)"
- Previous message: Markus Ernst: "Re: Create a PHP Page Dynamically"
- In reply to: evilbreadbin: "ODBC, PHP and a lack of understanding."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|