Hi, didn't see a reply to your query so here goes:

odbc_result has two forms:

odbc_result($result, COLUMN_NUMBER)
e.g.
   echo odbc_result($result, 1); // return column 1 in result set

or

odbc_result($hStmt, "COLUMN_NAME")
e.g.
   echo odbc_result($result, "USER_ID"); // return column USER_ID in result set

You appear to be getting them a little confused.

Hope this helps

  _____  

~ Richard Allsebrook ~
Applications Developer and Webmaster
Easysoft Limited, Thorp Arch Grange, Thorp Arch, Wetherby, LS23 7BA, UK
http://www.easysoft.com <http://www.easysoft.com>  - http://www.cinema.com <http://www.cinema.com> 
"A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila."

  _____  

-----Original Message-----
From: christopher [mailto:christopher@netdimensions.com]
Sent: Friday, March 09, 2001 4:06 AM
To: php-db
Cc: christopher
Subject: FW: [PHP-DB] odbc_columns problem with MSSQL

I am trying to get the column names of some tables with odbc_columns from
MSSQL 2000.
As I extract a particular column from the result set, the browser hangs.

<html>
 <body>
 <?
  $con = odbc_connect("mydatabase", "christopher", "");
  $result = odbc_columns($con, "mydatabase", "dbo", "dtproperties");

  // this works!
  odbc_result_all($result);

  // but this doesn't.
  /*
  while (odbc_fetch_row($result))
   echo odbc_result($result, COLUMN_NAME);
  */
 ?>
 </body>
</html>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net