Jump to content

Query problem / WHERE conditions


Go to solution Solved by Endymion,

Recommended Posts

  • Honorable Member

Hi,

i have a problem with a query...

 

This is my working query:

SELECT l.id AS id, l.login_time AS login, l.logout_time AS logout, p.name AS name 
	FROM log.loginlog2 AS l 
	LEFT JOIN player.player AS p ON (p.id = l.pid) 
	WHERE DATE_SUB(NOW(), INTERVAL 14 DAY) < l.logout_time
	ORDER BY l.id DESC;

 

This is my non-working query:

SELECT l.id AS id, l.login_time AS login, l.logout_time AS logout, p.name AS name 
	FROM log.loginlog2 AS l 
	LEFT JOIN player.player AS p ON (p.id = l.pid) 
	WHERE DATE_SUB(NOW(), INTERVAL 14 DAY) < l.logout_time
	AND WHERE l.is_gm = 'Y'
	ORDER BY l.id DESC;

 

This is the error i get:

Quote

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE l.is_gm = 'Y'  ORDER BY l.id DESC' at line 5

 

Can you tell me why? Or provide me a solution? I really don't want to do a work-around in php... <_<

 

Thank you,

.PolluX

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.