SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question about mysql_num_rows

    The query below works fine, however, I am not getting a number returned for $distinctUsers. Can anyone see what I've obviously overlooked?

    Thanks!


    PHP Code:
    $users "SELECT distinct m.uID, u.firstName, u.email, count(*) as totalMatches FROM matches m left JOIN users u on m.uID = u.uID WHERE m.processed is null and date(dateScheduled) = curdate() GROUP by m.uID";

    $distinctUsers mysql_num_rows($users);

    $usersResult mysql_query($users) OR die; 
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,122
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    You need to put that line after $usersResult and instead of passing $users, you need to pass $usersResult.

    PHP Code:
    $users "SELECT distinct m.uID, u.firstName, u.email, count(*) as totalMatches FROM matches m left JOIN users u on m.uID = u.uID WHERE m.processed is null and date(dateScheduled) = curdate() GROUP by m.uID";

    $usersResult mysql_query($users) OR die;  

    $distinctUsers mysql_num_rows($usersResult); 

  3. #3
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you!
    Convert your dollars into silver coins. www.convert2silver.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •