hi..
in the documentation it says this will happen "with many drivers"; anyone know what these are and how to resolve this?
failing that, all i need is a way to retrieve a recordcount without having to loop over the query result..
ta[/i]
odbc_num_rows always returns -1
Moderator: General Moderators
-
princessAlbert
- Forum Newbie
- Posts: 2
- Joined: Tue May 13, 2003 4:38 pm
- Location: London
-
princessAlbert
- Forum Newbie
- Posts: 2
- Joined: Tue May 13, 2003 4:38 pm
- Location: London
hi.. more detail.. ok:
i am using PHP 4.3.1
here's my query stuff:
$dsn="ds";
$conn=odbc_connect($dsn, "u", "pw");
$query="select * from somewhere";
$result=odbc_Exec($conn, $query);
now when i do this:
while(odbc_fetch_row($result))
{ echo "test<br>";
}
i get a list which proves records were found, but when i do this:
echo odbc_num_rows($result);
i get -1. all i want is to find the recordcount!!!
thanks
yes it is; i can't help it; i was born into it :P
i am using PHP 4.3.1
here's my query stuff:
$dsn="ds";
$conn=odbc_connect($dsn, "u", "pw");
$query="select * from somewhere";
$result=odbc_Exec($conn, $query);
now when i do this:
while(odbc_fetch_row($result))
{ echo "test<br>";
}
i get a list which proves records were found, but when i do this:
echo odbc_num_rows($result);
i get -1. all i want is to find the recordcount!!!
thanks
yes it is; i can't help it; i was born into it :P
the user contributed notes at http://www.php.net/manual/en/function.odbc-num-rows.php offer some workarounds