Use IN
.
$sql="SELECT *
FROM `table`
WHERE `id` IN (" . implode(',', array_map('intval', $array)) . ')';
More Related Contents:
- Getting links from db and displaying them in another div [closed]
- HTML Form/PHP connected but MySQL is empty
- Needle in a Haystack for Php [closed]
- Thank you for helping [closed]
- Create hyperlink from html table row to open record on a new page
- How to insert images into a database using PHP [closed]
- Multiple inputs with same name through POST in php
- Sum values of multidimensional array by key without loop
- HTML input arrays
- How to upload images into MySQL database using PHP code
- How to create a HTML Table from a PHP array?
- Notice: Array to string conversion in
- mysql_fetch_array, mysql_fetch_assoc, mysql_fetch_object
- HTML – Change\Update page contents without refreshing\reloading the page
- “slash before every quote” problem [duplicate]
- mysql_fetch_array() expects parameter 1 to be resource problem [duplicate]
- mysql select query within a serialized array
- mysqli_query() expects at least 2 parameters, 1 given in? [duplicate]
- Echo menu tree with recursive function
- Sending HTML Code Through JSON
- Javascript function post and call php script
- PHP: Inserting Values from the Form into MySQL
- onbeforeprint() and onafterprint() equivalent for non IE browsers
- How to insert json array into mysql database
- Why do I get “Resource id #4” when I apply print_r() to an array in PHP? [duplicate]
- Turkish characters are not displayed correctly [duplicate]
- PHP/SQL Insert Error when using Named Placeholders
- Create PHP array from MySQL column
- Save array in mysql database
- Using PHP to upload file and add the path to MySQL database