Jump to content

select query help!


alena1347

Recommended Posts

As barand stated:

 

 

$sql=mysql_query("SELECT * FROM TABLE WHERE id IN (1,2,3)");
 

 

 

this will return 3 results (if they exists), where id = 1 OR id = 2 OR id = 3.

 

However, Barand, wouldn't this:

 

$sql = "SELECT * FROM TABLE WHERE id IN ($list)";
 

 

 

require an implode() ?

Link to comment
https://forums.phpfreaks.com/topic/275690-select-query-help/#findComment-1419321
Share on other sites

As barand stated:

 

 

$sql=mysql_query("SELECT * FROM TABLE WHERE id IN (1,2,3)");
 

 

 

this will return 3 results (if they exists), where id = 1 OR id = 2 OR id = 3.

 

However, Barand, wouldn't this:

 

$sql = "SELECT * FROM TABLE WHERE id IN ($list)";
 

 

 

require an implode() ?

thank you was missing something this solved it.

Link to comment
https://forums.phpfreaks.com/topic/275690-select-query-help/#findComment-1419745
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.