RE: [PHP-DB] odbc_columns problem with MSSQL
| From: | Allsebrook_Richard/askr at askr dot easysoft dot com | Date: | Mon, 12 Mar 2001 10:11:28 +0000 |
| Subject: | RE: [PHP-DB] odbc_columns problem with MSSQL | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-7304@lists.php.net to get a copy of this message | ||
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
Attachment: [application/rtf]
Attachment: [application/rtf]