Can"t figure out why getting "query was empty" error
am 24.12.2006 05:49:36 von pantichd
Hello,
I am new to php so bear with me. I have a simple php file that tries to
insert data into a mySQL database table.
When I try to run it I get a "query was empty". I've googled this error
message and found many, many hits but I still can't figure out what's wrong
with my script.
Here's a snippet:
// Connect to db
$con=mysql_connect ("localhost", "", "") or die ('I cannot
connect to the database because: ' . mysql_error());
// Select db
mysql_select_db ("");
echo(date("l dS \of F Y h:i:s A") . "
");
mysql_query("INSERT INTO person (FirstName, LastName, Age) VALUES('Jack',
'Bauer', '67')");
//Try to insert the record
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
// Close the connection
mysql_query($sql,$con);mysql_close($con);
?>
This seems like it should be a simple thing to do but I can NOT figure it
out.
Any help would be greatly appreciatetd.
--
View this message in context: http://www.nabble.com/Can%27t-figure-out-why-getting-%22quer y-was-empty%22-error-tf2876259.html#a8039188
Sent from the Php - Database mailing list archive at Nabble.com.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Can"t figure out why getting "query was empty" error
am 24.12.2006 07:08:02 von pantichd
Figured it out.
The name of the table was "Person" instead of "person"...First letter was a
capital "P"
I didn't realize that the sql was case-sensitive.
--
View this message in context: http://www.nabble.com/Can%27t-figure-out-why-getting-%22quer y-was-empty%22-error-tf2876259.html#a8039436
Sent from the Php - Database mailing list archive at Nabble.com.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Can"t figure out why getting "query was empty" error
am 04.01.2007 03:07:50 von Chris
pantichd wrote:
> Figured it out.
>
> The name of the table was "Person" instead of "person"...First letter was a
> capital "P"
>
> I didn't realize that the sql was case-sensitive.
It is with table names, field names and table aliases. Stuff like
"SELECT", "INSERT", "UPDATE", "WHERE" isn't case sensitive (the sql
keywords).
Also - if you want help, please post the problem code *exactly*.
You had three problems in the post that have nothing to do with this
solution:
mysql_select_db ("
");
(Not really a problem but I highly doubt your database is called "")
mysql_query("INSERT INTO person (FirstName, LastName, Age) VALUES('Jack',
'Bauer', '67')");
//Try to insert the record
if (!mysql_query($sql,$con))
$sql is not defined anywhere - this would produce a "query is empty" error.
and finally you were running the query twice. It's not a "problem" but
it would be a hard-to-find-bug:
// Close the connection
mysql_query($sql,$con);mysql_close($con);
If you post the exact code that's having the problem it makes it so much
easier for everyone to help...
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Can"t figure out why getting "query was empty" error
am 04.01.2007 13:34:32 von pantichd
Chris,
My bad! You're right. I was trying to put in a simple clean example but I
didn't clean it up enough.
I did find all those 'problems' in my posted code later but forgot to
include them when I posted what the final resolution was.
Thanks!
Chris wrote:
Also - if you want help, please post the problem code *exactly*.
You had three problems in the post that have nothing to do with this
solution...
--
View this message in context: http://www.nabble.com/Can%27t-figure-out-why-getting-%22quer y-was-empty%22-error-tf2876259.html#a8158374
Sent from the Php - Database mailing list archive at Nabble.com.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Multiple Count"s in one Select.
am 05.01.2007 05:29:23 von Ed
Hi,
I've been expermenting with displaying stats for our intranet and I'm
looking at making it more robust so it can display stats better.
I've come up with the most ugly! long winded SQL statement You could
imagine.
SELECT DISTINCT u.*, t.*, (SELECT COUNT(jobtype) FROM taskinput WHERE
t.user_id = u.user_id ) AS 'COUNT', (SELECT COUNT(jobtype) FROM taskinput
WHERE t.user_id = u.user_id AND t.jobtype = 'Navision') AS 'Navision',
(SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id = u.user_id AND
t.jobtype = 'Abuse'') AS 'Abuse', (SELECT COUNT(jobtype) FROM taskinput
WHERE t.user_id = u.user_id AND t.jobtype = 'Tickets') AS 'Tickets', (SELECT
COUNT(jobtype) FROM taskinput WHERE t.user_id = u.user_id) AS 'MegaTotals'
FROM users u, taskinput t WHERE t.user_id = u.user_id GROUP BY u.user_id,
t.user_id ORDER BY COUNT DESC
I've never down anything so long in all the time i've been playing and it's
causing my CPU to go crazy although i'm only using 126mb of my 2.5GB of RAM.
The query in question is fine if I strip out the WHERE t.user_id = u.user_id
from each SELECT COUNT it goes through in less than a second in fact but
doesnt display the results properly it gives every user the same listings.
Surely there must be a more efficent way of doing this? but i've not been
able to find one that executes quickly.
Any help of stripping the code down too it's bare minimum and getting the
results quickly would be welcome :)
Thanks
Ed
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Multiple Count"s in one Select.
am 05.01.2007 06:03:00 von Chris
Ed wrote:
> Hi,
>
> I've been expermenting with displaying stats for our intranet and I'm
> looking at making it more robust so it can display stats better.
>
> I've come up with the most ugly! long winded SQL statement You could
> imagine.
>
> SELECT DISTINCT u.*, t.*, (SELECT COUNT(jobtype) FROM taskinput WHERE
> t.user_id = u.user_id ) AS 'COUNT', (SELECT COUNT(jobtype) FROM
> taskinput WHERE t.user_id = u.user_id AND t.jobtype = 'Navision') AS
> 'Navision', (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id =
> u.user_id AND t.jobtype = 'Abuse'') AS 'Abuse', (SELECT COUNT(jobtype)
> FROM taskinput WHERE t.user_id = u.user_id AND t.jobtype = 'Tickets') AS
> 'Tickets', (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id =
> u.user_id) AS 'MegaTotals' FROM users u, taskinput t WHERE t.user_id =
> u.user_id GROUP BY u.user_id, t.user_id ORDER BY COUNT DESC
>
> I've never down anything so long in all the time i've been playing and
> it's causing my CPU to go crazy although i'm only using 126mb of my
> 2.5GB of RAM.
>
> The query in question is fine if I strip out the WHERE t.user_id =
> u.user_id from each SELECT COUNT it goes through in less than a second
> in fact but doesnt display the results properly it gives every user the
> same listings. Surely there must be a more efficent way of doing this?
> but i've not been able to find one that executes quickly.
What indexes do you have?
Do you have one on
taskinput(user_id)
and
users(user_id) ?
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Multiple Count"s in one Select.
am 05.01.2007 06:22:36 von Ed
As this is a new db i've not done any indexing.
There's only 4 rows in the table.
SELECT DISTINCT u.user_id, u.username, t.user_id, t.jobtype, (SELECT
COUNT(jobtype) FROM taskinput) AS 'COUNT', (SELECT COUNT(jobtype) FROM
taskinput WHERE t.jobtype = 'Navision') AS 'Navision', (SELECT
COUNT(jobtype) FROM taskinput WHERE t.jobtype = 'Abuse') AS 'Abuse', (SELECT
COUNT(jobtype) FROM taskinput WHERE t.jobtype = 'Tickets') AS 'Tickets',
(SELECT COUNT(jobtype) FROM taskinput) AS 'MegaTotals' FROM users u,
taskinput t WHERE t.user_id = u.user_id GROUP BY u.user_id, t.user_id;
+---------+---------------+---------+---------+-------+----- -----+-------+---------+------------+
| user_id | username | user_id | jobtype | COUNT | Navision | Abuse |
Tickets | MegaTotals |
+---------+---------------+---------+---------+-------+----- -----+-------+---------+------------+
| 1 | edd | 1 | Tickets | 4 | 0 | 0
| 0 | 4 |
| 10 | administrator | 10 | Tickets | 4 | 0 | 0 |
4 | 4 |
+---------+---------------+---------+---------+-------+----- -----+-------+---------+------------+
2 rows in set (0.00 sec)
Notice how i've removed the WHERE t.user_id = u.user_id from each SELECT
count? it's flown through but seems to be putting all the same results in
each count.
It takes far too long to get any kind of result where adding the extra WHERE
t.user_id = u.user_id AND t.jobtype = 'Tickets'
It's got me stumped, but then i've not slept in nearly 24 hours.
Thanks for your help so far :-)
----- Original Message -----
From: "Chris"
To: "Ed"
Cc:
Sent: Friday, January 05, 2007 5:03 AM
Subject: Re: [PHP-DB] Multiple Count's in one Select.
> Ed wrote:
>> Hi,
>>
>> I've been expermenting with displaying stats for our intranet and I'm
>> looking at making it more robust so it can display stats better.
>>
>> I've come up with the most ugly! long winded SQL statement You could
>> imagine.
>>
>> SELECT DISTINCT u.*, t.*, (SELECT COUNT(jobtype) FROM taskinput WHERE
>> t.user_id = u.user_id ) AS 'COUNT', (SELECT COUNT(jobtype) FROM taskinput
>> WHERE t.user_id = u.user_id AND t.jobtype = 'Navision') AS 'Navision',
>> (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id = u.user_id AND
>> t.jobtype = 'Abuse'') AS 'Abuse', (SELECT COUNT(jobtype) FROM taskinput
>> WHERE t.user_id = u.user_id AND t.jobtype = 'Tickets') AS 'Tickets',
>> (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id = u.user_id) AS
>> 'MegaTotals' FROM users u, taskinput t WHERE t.user_id = u.user_id GROUP
>> BY u.user_id, t.user_id ORDER BY COUNT DESC
>>
>> I've never down anything so long in all the time i've been playing and
>> it's causing my CPU to go crazy although i'm only using 126mb of my 2.5GB
>> of RAM.
>>
>> The query in question is fine if I strip out the WHERE t.user_id =
>> u.user_id from each SELECT COUNT it goes through in less than a second in
>> fact but doesnt display the results properly it gives every user the same
>> listings. Surely there must be a more efficent way of doing this? but
>> i've not been able to find one that executes quickly.
>
> What indexes do you have?
>
> Do you have one on
>
> taskinput(user_id)
>
> and
>
> users(user_id) ?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Multiple Count"s in one Select.
am 05.01.2007 06:23:53 von Chris
[ please don't top-post, makes it hard to follow ]
Ed wrote:
> As this is a new db i've not done any indexing.
>
> There's only 4 rows in the table.
>
> SELECT DISTINCT u.user_id, u.username, t.user_id, t.jobtype, (SELECT
> COUNT(jobtype) FROM taskinput) AS 'COUNT', (SELECT COUNT(jobtype) FROM
> taskinput WHERE t.jobtype = 'Navision') AS 'Navision', (SELECT
> COUNT(jobtype) FROM taskinput WHERE t.jobtype = 'Abuse') AS 'Abuse',
> (SELECT COUNT(jobtype) FROM taskinput WHERE t.jobtype = 'Tickets') AS
> 'Tickets', (SELECT COUNT(jobtype) FROM taskinput) AS 'MegaTotals' FROM
> users u, taskinput t WHERE t.user_id = u.user_id GROUP BY u.user_id,
> t.user_id;
> +---------+---------------+---------+---------+-------+----- -----+-------+---------+------------+
>
> | user_id | username | user_id | jobtype | COUNT | Navision | Abuse
> | Tickets | MegaTotals |
> +---------+---------------+---------+---------+-------+----- -----+-------+---------+------------+
>
> | 1 | edd | 1 | Tickets | 4 | 0
> | 0 | 0 | 4 |
> | 10 | administrator | 10 | Tickets | 4 | 0 | 0
> | 4 | 4 |
> +---------+---------------+---------+---------+-------+----- -----+-------+---------+------------+
>
> 2 rows in set (0.00 sec)
>
>
> Notice how i've removed the WHERE t.user_id = u.user_id from each SELECT
> count? it's flown through but seems to be putting all the same results
> in each count.
>
> It takes far too long to get any kind of result where adding the extra
> WHERE t.user_id = u.user_id AND t.jobtype = 'Tickets'
>
> It's got me stumped, but then i've not slept in nearly 24 hours.
Can you provide table info or a small database dump ? Probably best to
send off list if that's ok.
You have a complicated query so it'll be easier seeing the table
definitions and having some data to work with ;)
> ----- Original Message ----- From: "Chris"
> To: "Ed"
> Cc:
> Sent: Friday, January 05, 2007 5:03 AM
> Subject: Re: [PHP-DB] Multiple Count's in one Select.
>
>
>> Ed wrote:
>>> Hi,
>>>
>>> I've been expermenting with displaying stats for our intranet and I'm
>>> looking at making it more robust so it can display stats better.
>>>
>>> I've come up with the most ugly! long winded SQL statement You could
>>> imagine.
>>>
>>> SELECT DISTINCT u.*, t.*, (SELECT COUNT(jobtype) FROM taskinput WHERE
>>> t.user_id = u.user_id ) AS 'COUNT', (SELECT COUNT(jobtype) FROM
>>> taskinput WHERE t.user_id = u.user_id AND t.jobtype = 'Navision') AS
>>> 'Navision', (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id =
>>> u.user_id AND t.jobtype = 'Abuse'') AS 'Abuse', (SELECT
>>> COUNT(jobtype) FROM taskinput WHERE t.user_id = u.user_id AND
>>> t.jobtype = 'Tickets') AS 'Tickets', (SELECT COUNT(jobtype) FROM
>>> taskinput WHERE t.user_id = u.user_id) AS 'MegaTotals' FROM users u,
>>> taskinput t WHERE t.user_id = u.user_id GROUP BY u.user_id,
>>> t.user_id ORDER BY COUNT DESC
>>>
>>> I've never down anything so long in all the time i've been playing
>>> and it's causing my CPU to go crazy although i'm only using 126mb of
>>> my 2.5GB of RAM.
>>>
>>> The query in question is fine if I strip out the WHERE t.user_id =
>>> u.user_id from each SELECT COUNT it goes through in less than a
>>> second in fact but doesnt display the results properly it gives every
>>> user the same listings. Surely there must be a more efficent way of
>>> doing this? but i've not been able to find one that executes quickly.
>>
>> What indexes do you have?
>>
>> Do you have one on
>>
>> taskinput(user_id)
>>
>> and
>>
>> users(user_id) ?
>>
>> --
>> Postgresql & php tutorials
>> http://www.designmagick.com/
>>
>
>
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Multiple Count"s in one Select.
am 05.01.2007 06:32:21 von Ed
----- Original Message -----
From: "Chris"
To: "Ed"
Cc:
Sent: Friday, January 05, 2007 5:23 AM
Subject: Re: [PHP-DB] Multiple Count's in one Select.
>
> [ please don't top-post, makes it hard to follow ]
>
> Ed wrote:
>> As this is a new db i've not done any indexing.
>>
>> There's only 4 rows in the table.
>>
>> SELECT DISTINCT u.user_id, u.username, t.user_id, t.jobtype, (SELECT
>> COUNT(jobtype) FROM taskinput) AS 'COUNT', (SELECT COUNT(jobtype) FROM
>> taskinput WHERE t.jobtype = 'Navision') AS 'Navision', (SELECT
>> COUNT(jobtype) FROM taskinput WHERE t.jobtype = 'Abuse') AS 'Abuse',
>> (SELECT COUNT(jobtype) FROM taskinput WHERE t.jobtype = 'Tickets') AS
>> 'Tickets', (SELECT COUNT(jobtype) FROM taskinput) AS 'MegaTotals' FROM
>> users u, taskinput t WHERE t.user_id = u.user_id GROUP BY u.user_id,
>> t.user_id;
>> +---------+---------------+---------+---------+-------+----- -----+-------+---------+------------+
>> | user_id | username | user_id | jobtype | COUNT | Navision | Abuse
>> | Tickets | MegaTotals |
>> +---------+---------------+---------+---------+-------+----- -----+-------+---------+------------+
>> | 1 | edd | 1 | Tickets | 4 | 0 |
>> 0 | 0 | 4 |
>> | 10 | administrator | 10 | Tickets | 4 | 0 | 0
>> | 4 | 4 |
>> +---------+---------------+---------+---------+-------+----- -----+-------+---------+------------+
>> 2 rows in set (0.00 sec)
>>
>>
>> Notice how i've removed the WHERE t.user_id = u.user_id from each SELECT
>> count? it's flown through but seems to be putting all the same results in
>> each count.
>>
>> It takes far too long to get any kind of result where adding the extra
>> WHERE t.user_id = u.user_id AND t.jobtype = 'Tickets'
>>
>> It's got me stumped, but then i've not slept in nearly 24 hours.
>
> Can you provide table info or a small database dump ? Probably best to
> send off list if that's ok.
>
> You have a complicated query so it'll be easier seeing the table
> definitions and having some data to work with ;)
>
>
>> ----- Original Message ----- From: "Chris"
>> To: "Ed"
>> Cc:
>> Sent: Friday, January 05, 2007 5:03 AM
>> Subject: Re: [PHP-DB] Multiple Count's in one Select.
>>
>>
>>> Ed wrote:
>>>> Hi,
>>>>
>>>> I've been expermenting with displaying stats for our intranet and I'm
>>>> looking at making it more robust so it can display stats better.
>>>>
>>>> I've come up with the most ugly! long winded SQL statement You could
>>>> imagine.
>>>>
>>>> SELECT DISTINCT u.*, t.*, (SELECT COUNT(jobtype) FROM taskinput WHERE
>>>> t.user_id = u.user_id ) AS 'COUNT', (SELECT COUNT(jobtype) FROM
>>>> taskinput WHERE t.user_id = u.user_id AND t.jobtype = 'Navision') AS
>>>> 'Navision', (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id =
>>>> u.user_id AND t.jobtype = 'Abuse'') AS 'Abuse', (SELECT COUNT(jobtype)
>>>> FROM taskinput WHERE t.user_id = u.user_id AND t.jobtype = 'Tickets')
>>>> AS 'Tickets', (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id =
>>>> u.user_id) AS 'MegaTotals' FROM users u, taskinput t WHERE t.user_id =
>>>> u.user_id GROUP BY u.user_id, t.user_id ORDER BY COUNT DESC
>>>>
>>>> I've never down anything so long in all the time i've been playing and
>>>> it's causing my CPU to go crazy although i'm only using 126mb of my
>>>> 2.5GB of RAM.
>>>>
>>>> The query in question is fine if I strip out the WHERE t.user_id =
>>>> u.user_id from each SELECT COUNT it goes through in less than a second
>>>> in fact but doesnt display the results properly it gives every user the
>>>> same listings. Surely there must be a more efficent way of doing this?
>>>> but i've not been able to find one that executes quickly.
>>>
>>> What indexes do you have?
>>>
>>> Do you have one on
>>>
>>> taskinput(user_id)
>>>
>>> and
>>>
>>> users(user_id) ?
>>>
>>> --
>>> Postgresql & php tutorials
>>> http://www.designmagick.com/
>>>
>>
>>
>
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
Sent a DB dump to you off list :)
Thanks again.
Ed
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Multiple Count"s in one Select.
am 05.01.2007 14:19:51 von Oskar
Ed wrote:
> SELECT DISTINCT u.*, t.*, (SELECT COUNT(jobtype) FROM taskinput WHERE
> t.user_id = u.user_id ) AS 'COUNT', (SELECT COUNT(jobtype) FROM
> taskinput WHERE t.user_id = u.user_id AND t.jobtype = 'Navision') AS
> 'Navision', (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id =
> u.user_id AND t.jobtype = 'Abuse'') AS 'Abuse', (SELECT COUNT(jobtype)
> FROM taskinput WHERE t.user_id = u.user_id AND t.jobtype = 'Tickets')
> AS 'Tickets', (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id =
> u.user_id) AS 'MegaTotals' FROM users u, taskinput t WHERE t.user_id =
> u.user_id GROUP BY u.user_id, t.user_id ORDER BY COUNT DESC
I quess you are wrongly using aliases - try this and let me know:
SELECT
DISTINCT u.*, t.*,
(SELECT COUNT(jobtype) FROM taskinput WHERE user_id=u.user_id) AS 'COUNT',
(SELECT COUNT(jobtype) FROM taskinput WHERE user_id=u.user_id AND jobtype = 'Navision') AS 'Navision',
(SELECT COUNT(jobtype) FROM taskinput WHERE user_id=u.user_id AND jobtype = 'Abuse'') AS 'Abuse',
(SELECT COUNT(jobtype) FROM taskinput WHERE user_id=u.user_id AND jobtype = 'Tickets') AS 'Tickets',
(SELECT COUNT(jobtype) FROM taskinput WHERE user_id=u.user_id) AS 'MegaTotals'
FROM
users u, taskinput t
WHERE
t.user_id = u.user_id
GROUP BY
u.user_id, t.user_id
ORDER BY COUNT DESC
OKi98
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Multiple Count"s in one Select.
am 05.01.2007 21:16:20 von Ed
----- Original Message -----
From: "OKi98"
To:
Sent: Friday, January 05, 2007 1:19 PM
Subject: Re: [PHP-DB] Multiple Count's in one Select.
> Ed wrote:
>
>> SELECT DISTINCT u.*, t.*, (SELECT COUNT(jobtype) FROM taskinput WHERE
>> t.user_id = u.user_id ) AS 'COUNT', (SELECT COUNT(jobtype) FROM taskinput
>> WHERE t.user_id = u.user_id AND t.jobtype = 'Navision') AS 'Navision',
>> (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id = u.user_id AND
>> t.jobtype = 'Abuse'') AS 'Abuse', (SELECT COUNT(jobtype) FROM taskinput
>> WHERE t.user_id = u.user_id AND t.jobtype = 'Tickets') AS 'Tickets',
>> (SELECT COUNT(jobtype) FROM taskinput WHERE t.user_id = u.user_id) AS
>> 'MegaTotals' FROM users u, taskinput t WHERE t.user_id = u.user_id GROUP
>> BY u.user_id, t.user_id ORDER BY COUNT DESC
>
> I quess you are wrongly using aliases - try this and let me know:
>
> SELECT
> DISTINCT u.*, t.*,
> (SELECT COUNT(jobtype) FROM taskinput WHERE user_id=u.user_id) AS
> 'COUNT',
> (SELECT COUNT(jobtype) FROM taskinput WHERE user_id=u.user_id AND
> jobtype = 'Navision') AS 'Navision',
> (SELECT COUNT(jobtype) FROM taskinput WHERE user_id=u.user_id AND
> jobtype = 'Abuse'') AS 'Abuse',
> (SELECT COUNT(jobtype) FROM taskinput WHERE user_id=u.user_id AND
> jobtype = 'Tickets') AS 'Tickets',
> (SELECT COUNT(jobtype) FROM taskinput WHERE user_id=u.user_id) AS
> 'MegaTotals'
> FROM
> users u, taskinput t
> WHERE
> t.user_id = u.user_id
> GROUP BY
> u.user_id, t.user_id
> ORDER BY COUNT DESC
>
> OKi98
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Thank you very much! that seemed todo the trick nicely :)
Thank you everyone who helped you've been very helpful.
Ed
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php