odbc question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>$sql = "SELECT * FROM users WHERE username='$username' AND
password='$password'";
>$result = odbc_exec($dbConnection, $sql);
>
>while ($rows = odbc_fetch_array($result)) {
>     //This doesn't work with odbc_fetch_object either
>     print $rows->COLUMNNAME;
>}

It's returning an array, not an object (I can't speak as to how the
odbc_fetch_object function behaves - it seems poorly documented, but it
looks like you get back something more fancy than a simple object with
named variables).

In short, use odbc_fetch_array and refer to the items as
$rows["COLUMNNAME"] (or use single quotes).


- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux