ODBC problems :( num_rows and another
Posted: Thu Jun 22, 2006 4:56 pm
I have the following code
I KEEP getting some cursor error (Im sorry I dont remember the exact error and I cant check right now). This is VERY frustrating and I need to solve it. Any suggestions.
Secondly, as it states on the php.net website, odbc_num_rows works very poorly in many cases including mine, so what I did is simply use something along these lines
I really dont like this, is there any better way?
Thanks alot in advance
Code: Select all
//Allready conected to database
$sql = "select * from users where user_id='4'";
$result = odbc_exec($dblink, $sql);
$row = odbc_fetch_array($result);
echo $row['name'];
//The above works properly with no problems what so ever
$sql = "select * from products where product_id='3'";
$result = odbc_exec($dblink, $sql); //Here I get the errorSecondly, as it states on the php.net website, odbc_num_rows works very poorly in many cases including mine, so what I did is simply use something along these lines
Code: Select all
$counter = 0;
while(odbc_fetch_row($result))
{
$counter++;
}
echo $counter;Thanks alot in advance