Windows 7.
- Details
- Category: MySQL
- Published on Friday, 17 September 2010 15:03
- Hits: 479
If you can't connect to MySQL over PHP from your localhost, then try something like:
In the Windows/System32/drivers/etc/hosts file remove the entry like this:
::1 localhost
and make sure you still have:
127.0.0.1 localhost
Taken from here.
Union count.
- Details
- Category: MySQL
- Published on Wednesday, 20 August 2008 07:37
- Hits: 663
Question is, how to get count records in union query?
For example, we have this query:
select count(*) from jos_content
union all
select count(*) from jos_users
As a result, we will have two records:
| count(*) |
|---|
| 904ĂÂ |
| 1ĂÂ |
And we want to get result as one record, 905, how?
Like this:
select ((select count(*) from jos_content) + (select count(*) from jos_users)) count
Taken from here.

