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
https://metin2.dev/topic/15639-query-problem-where-conditions/
Share on other sites

  • Active Member
  • Solution

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  l.is_gm = 'Y'
    ORDER BY l.id DESC;

  • Love 1

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.