[PHP] odbc fetch array issues

2004-11-16 Thread Adil
Hey people,

Anyone know much about odbc_fetch_array() or odbc_fetch_object() functions
in php.  My while loop keeps breaking while using this function.  I'm trying
to grab a row from the result returned by the database query and for testing
purposes, just printing out each item in the row as follows:

$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;
  }


I get nothing at all which I find pretty strange so I wanted to know if
there were any bugs with this function, maye while working on IIS or just
problems with the functions themselves.

Thx again
Adil.

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



RE: [PHP] odbc fetch array issues

2004-11-16 Thread Jay Blanchard
[snip]
$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;
  }
[/snip]

For odbc_fetch_array you would have to use

print $rows['COLUMNNAME'];

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