RE: Displaying SQL Results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



try

     while($row = $db->sql_fetchrow($result))
     {

            //[INSERT CODE HERE, I want to display the 'user' and 'count']
            $user  = $row[0];
            $count = $row[1];

     }

bastien


From: JM <frawst1@xxxxxxxxx>
To: php-db@xxxxxxxxxxxxx
Subject:  Displaying SQL Results
Date: Fri, 8 Sep 2006 11:58:46 -0700

Hi all,
Can anyone tell me what the syntax would be to display or gather the results
of this SQL?

SELECT MAX(user), COUNT(*) FROM my_table GROUP BY user ASC;

$sql_records = "SELECT MAX(user), email, COUNT(*) FROM my_table GROUP BY
user ;";

if($result = $db->sql_query($sql_records))
{
// fetch associative array
      while($row = $db->sql_fetchrow($result))
      {

             [INSERT CODE HERE, I want to display the 'user' and 'count']

      }
      $db->sql_freeresult($result);
}



Thanks for any help!

J

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux