southpaw93
southpaw93

Reputation: 1961

PHP , Mysql selecting row

I seem to be having some difficulties with retrieving data from Mysql.

I tried this in PhpMyAdmin SQL:

SELECT *
FROM `ads1`
WHERE state IN ( 'Romania , Germany' )

and the code works but nothing gets returned.

I have a table with value in it and a PHP variable having this format: name1,name2,name3,....,nameN, all in one variable.

Now the idea is that if the table value is contained in the PHP variable, the row get's selected.

Do you guys suggest anything?

Upvotes: 0

Views: 108

Answers (1)

juergen d
juergen d

Reputation: 204756

SELECT * FROM ads1 WHERE state IN ( 'Romania' , 'Germany' )

You have to put every entry in quotes and not just the hole input.

Upvotes: 3

Related Questions