Jump to content

[SOLVED] My sql select multiple multiple rows


rcorlew

Recommended Posts

Okay, I am having problems with querying my db by multiple id(s). To clarify more, I am trying to match the id of each row to an array that has been formatted into a string seperated by commas. Here is my code to see if anyone can help.

 

<?php
$str = "1,2,3,4";

$query = "SELECT * FROM table WHERE p_id = IN($str)";
?>

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.