Jump to content
xisto Community
Sign in to follow this  
Roly

Problem With Mysql Query

Recommended Posts

I know this isn't the SQL forum but MySQL is used in PHP. I get an error

 

Query: SELECT COUNT(users.*), COUNT(guests.*) FROM users INNER JOIN guests ON users.code != '' AND users.last_active >= 1106971028 AND guests.time >= 1106971028 AND users.last_ip != guests.ip

Error#1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '*), COUNT(guests.*) FROM users INNER JOIN guests ON users.code

Share this post


Link to post
Share on other sites

SELECT COUNT(users.*), COUNT(guests.*)FROM users INNER JOIN guestsON (users.code != '' AND users.last_active >= 1106971028AND guests.time >= 1106971028AND users.last_ip != guests.ip)OR If you have missed the WHERE clause it will be something like this,SELECT COUNT(users.*), COUNT(guests.*)FROM users INNER JOIN guestsON (users.code != '' ) WHERE users.last_active >= 1106971028AND guests.time >= 1106971028AND users.last_ip != guests.ip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.