Jump to content

ODBC Access alternative to mysql_num_rows


ChambeRFienD

Recommended Posts

[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
Share on other sites

Ok try this.
[code=php:0]
$query = odbc_exec($odbc, "SELECT * FROM user_info WHERE cc='$search'") or die("MySQL Database Error: " . odbc

while ($row = odbc_fetch_array($query)) {
    $count = count($row);
}
if ($count == 1) {
  //do something
}
[/code]

Hope that one works.
Tom

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.