In the PHP Manual ;

resource odbc_columns ( resource $connection_id [, string $qualifier [,
string $schema [, string $table_name [, string $column_name ]]]] )

Lists all columns in the requested range. 


connection_id  The ODBC connection identifier, see odbc_connect() for
qualifier      The qualifier. 
schema         The owner. 
table_name     The table name. 
column_name    The column name.

I the first email you send: $outval = odbc_columns($conn, "DB#LIBNAME", "%",
"TABLENAME", "%");

$conn is truly a connection object ?

You check if has no errors in the connection processes?

Alejandro M.S.

-----Mensagem original-----
De: Cheryl Sullivan [] 
Enviada em: quinta-feira, 26 de janeiro de 2012 13:41
Para: Jim Giner;
Assunto: RE: [PHP] Re: Getting Column Names from an AS400 Database

Thanks for your response... I changed the $outval line to 

$outval = odbc_columns($rs, "DB#LIBNAME", "%", "TABLENAME", "%");

...but still got the same error - 

Warning: odbc_columns() expects parameter 1 to be resource, object given in
D:\WAMP\www\directory\filename.php on line 13

-----Original Message-----
From: Jim Giner []
Sent: Thursday, January 26, 2012 10:31 AM
Subject: [PHP] Re: Getting Column Names from an AS400 Database

I'm thinking that it should read

$rs = $conn->execute($q);
$outval = odbc_columns($rs, "DB#LIBNAME", "%", "TABLENAME", "%");

You need to provide the results of the query to the odbc_columns, not the
connection object.
Just my guess since I've never used this. 

PHP General Mailing List (
To unsubscribe, visit:

Notice: This communication, including attachments, may contain information
that is confidential and protected. It constitutes non-public information
intended to be conveyed only to the designated recipient(s). If you believe
that you have received this communication in error, please notify the sender
immediately by return e-mail and promptly delete this e-mail, including
attachments without reading or saving them in any manner. The unauthorized
use, dissemination, distribution, or reproduction of this e-mail, including
attachments, is prohibited and may be unlawful. Thank you.

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to