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? Link to comment https://forums.phpfreaks.com/topic/18555-odbc-access-alternative-to-mysql_num_rows/ 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) { Link to comment https://forums.phpfreaks.com/topic/18555-odbc-access-alternative-to-mysql_num_rows/#findComment-79928 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] Link to comment https://forums.phpfreaks.com/topic/18555-odbc-access-alternative-to-mysql_num_rows/#findComment-79930 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 Link to comment https://forums.phpfreaks.com/topic/18555-odbc-access-alternative-to-mysql_num_rows/#findComment-79981 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 Link to comment https://forums.phpfreaks.com/topic/18555-odbc-access-alternative-to-mysql_num_rows/#findComment-79993 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 Link to comment https://forums.phpfreaks.com/topic/18555-odbc-access-alternative-to-mysql_num_rows/#findComment-80000 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.