Jump to content

sql Select from where value = array();


wee493

Recommended Posts

I have a table like the following.

Content

   

|

   

Value

google1

       

|

 

   

1

yahoo1

       

|

 

   

2

google2

       

|

 

   

1

facebook1

       

|

 

   

3

google3

       

|

 

   

1

facebook2

       

|

 

   

3

 

I need to do something like

 $sql = mysql_query("SELECT * FROM table WHERE value = '1' OR value = '2'"); 

 

Thats fairly simple, but I have a user login system where users can specify what data they want to see (Basically it's not always going to be pulling data where value = 1 or 2). So I am puling the values from the users profile and I need to know how I would transform an array of number into a WHERE value = '1' OR value = '2'" statement.

Link to comment
https://forums.phpfreaks.com/topic/177175-sql-select-from-where-value-array/
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.