Thanks for the quick reply. Actually I figured it out by using aliasing:
$sql_records = "SELECT MAX(user) AS user_name, email, COUNT(user) AS
user_count FROM table_1 GROUP BY user DESC LIMIT 10;";
print $row["user_name"] . " - " . $row["user_count"];
This will display the top 10 users in desc
2006/9/8, Julian Tree <[EMAIL PROTECTED]>:
I have a pretty complex data base that runs a lot of aggreated
function (sum, count in addtion to joins) constantly. If I turn off
pg_pconnect, the connection takes too long, if I turn on the
pg_pconnect, the connection eventually max out.
My current
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 <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] Displaying S
I have a pretty complex data base that runs a lot of aggreated
function (sum, count in addtion to joins) constantly. If I turn off
pg_pconnect, the connection takes too long, if I turn on the
pg_pconnect, the connection eventually max out.
My current solution is to have cron job to restart apac
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 a
I just switched a customer from one Windows host to another. The new
host is a Windows only shop, and not overly familiar with MySQL and PHP.
My customer has two PHP applications, both important to the site.
Everything else is ASP or ASP.NET.
When the new host installed PHP and MySQL, the web
> -Original Message-
> From: Chris [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 07, 2006 9:52 PM
> To: K.A.Bouton
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] sql output to a multidimensional array
>
>
> K.A.Bouton wrote:
> > I need the output of my sql to be a multidime