Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql where in array

-- SQL
SELECT * FROM table WHERE column IN('value1','value2','value3')

-- Javascript
$string="1,2,3,4,5";
$array=array_map('intval', explode(',', $string));
$array = implode("','",$array);
$query=mysqli_query($conn, "SELECT name FROM users WHERE id IN ('".$array."')");
Comment

PREVIOUS NEXT
Code Example
Sql :: select from one table where not on the other 
Sql :: left join with only first record 
Sql :: mysql show table column full description 
Sql :: change default maximum runtime mariadb from phpmyadmin 
Sql :: pl sql dynamic sql drop doesnt work 
Sql :: create user mysql 
Sql :: Disabling foreign key checks while performing Sqlalchemy Upgrade 
Sql :: oracle list data files 
Sql :: sql syntax find few columns 
Sql :: Aqua Data studio postgresql ssl 
Sql :: oracle nls instance 
Sql :: mysql drop column 
Sql :: sql server get type of column 
Sql :: sql list users and roles 
Sql :: $query = mysqli_query($con, $sql); while ($row = mysqli_fetch_array($query)) 
Sql :: update in sql 
Sql :: how to install mysql server on centos 7 
Sql :: remove spaces sql server 
Sql :: oracle add month 
Sql :: drop table 
Sql :: sql remove non numeric characters 
Sql :: sql server 2008 first and last day of month 
Sql :: delete index in postgresql 
Sql :: mysql sysdate 
Sql :: add user mysql wordpress 
Sql :: oracle grant select on schema 
Sql :: find wordpress version in database 
Sql :: mysql check db size 
Sql :: mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password] 
Sql :: mysql jdbc timezone 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =