Answers for "php array in sql"

PHP
18

php in array

$colors = array("red", "blue", "green"); 
 
if (in_array("red", $colors)) { 
	echo "found red in array"; 
}
Posted by: Guest on July-01-2019
3

php array

<?php
$array = array("foo", "bar", "hello", "world");
var_dump($array);
?>
Posted by: Guest on June-17-2020
0

implode in sql query

$sql = "SELECT * FROM table WHERE comp_id IN ('" 
     . implode("','", array_map('mysql_real_escape_string', $arr)) 
     . "')";
Posted by: Guest on November-24-2020

Browse Popular Code Answers by Language