ChambeRFienD Posted August 24, 2006 Share Posted August 24, 2006 I'm currently converting a script from using MySQL to Access. The only part I'm having trouble with is getting a mysql_num_row alternative for Access... Anyone have any ideas? Quote Link to comment Share on other sites More sharing options...
johndcastro Posted August 24, 2006 Share Posted August 24, 2006 Are you tring to loop through using while?If you you can use while (odbc_fetch_row($cur) { Quote Link to comment Share on other sites More sharing options...
ChambeRFienD Posted August 24, 2006 Author Share Posted August 24, 2006 [quote author=johndcastro link=topic=105499.msg421477#msg421477 date=1156439009]Are you tring to loop through using while?If you you can use while (odbc_fetch_row($cur) {[/quote]I just need to count the number of entries in a database that match a query.. Example:[code]$query = odbc_exec($odbc, "SELECT * FROM user_info WHERE cc='$search'") or die("MySQL Database Error: " . odbc_errormsg());$count = counting_funtion($query);if($count >= ......[/code] Quote Link to comment Share on other sites More sharing options...
tomfmason Posted August 24, 2006 Share Posted August 24, 2006 I think that you want [url=http://us3.php.net/manual/en/function.odbc-num-rows.php]odbc_num_rows[/url]. Hope this helps,Tom Quote Link to comment Share on other sites More sharing options...
ChambeRFienD Posted August 24, 2006 Author Share Posted August 24, 2006 [quote author=tomfmason link=topic=105499.msg421534#msg421534 date=1156445714]I think that you want [url=http://us3.php.net/manual/en/function.odbc-num-rows.php]odbc_num_rows[/url]. Hope this helps,Tom[/quote]Doesn't work with Access drivers. Returns with -1 Quote Link to comment Share on other sites More sharing options...
tomfmason Posted August 24, 2006 Share Posted August 24, 2006 Ok try this. [code=php:0]$query = odbc_exec($odbc, "SELECT * FROM user_info WHERE cc='$search'") or die("MySQL Database Error: " . odbcwhile ($row = odbc_fetch_array($query)) { $count = count($row);}if ($count == 1) { //do something}[/code]Hope that one works.Tom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.