Jump to content

Mysql Query


kigogu

Recommended Posts

I have a query like,

 

SELECT * FROM account_duplicate WHERE id = account.id AND account.found = 0 AND account.name LIKE %something%

 

What I want to do is select all the entries from the account_duplicate table where the id equals the id from the account table, the found value from the account table is equal to 0 and the name of the account is similar to "some name"

 

I am new to mysql so I am not sure how I might be able to do this lol I know it is probably something simple but any help would be appreciated ^^

Link to comment
https://forums.phpfreaks.com/topic/261125-mysql-query/
Share on other sites

Alright! I have found the answer, after searching forever. I just ended up doing a LEFT JOIN so my query ended up being:

SELECT * FROM account_duplicate LEFT JOIN account ON account_duplicate.id = account.id WHERE account.found = 0 AND account.name LIKE '%something%'

is this an alright result to go? no one really has to answer this, its only for more understanding, but as far as my original question is concerned it has been answered

Link to comment
https://forums.phpfreaks.com/topic/261125-mysql-query/#findComment-1338209
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.