PHPcode $ list = & quot; $ car = array ('name' = & gt; array (0 = & gt; array ('xm '= & gt;' I am special '), 1 = & gt; array ('xm' = & gt; ''), 2 = & gt; array (query of multiple mysql keywords
PHP code
$ List = ""; $ car = array ('name' => array (0 => array ('xm '=>' I am special '), 1 => array ('xm '=> ''), 2 => array ('xm '=> ''), 3 => array ('xm '=> ''); if (! $ Car ['name']) {$ list = 'Nothing ';} else {$ I = 1; foreach ($ car ['name'] as $ nm) {if (strstr ($ list, $ nm ['xm ']) & $ I = 1) {$ list = str_replace ($ nm ['xm'], $ nm ['xm ']. $ I, $ list); $ list. = $ nm ['xm ']. ($ I + 1 ). ','; $ I ++;} else {if (strstr ($ list, $ nm ['xm ']) {$ list. = $ nm ['xm ']. ($ I + 1); $ I ++;} else {$ list. = $ nm ['xm ']. ',';}}}}
SQL code
$sql="SELECT * FROM table where table.title in ('$list') limit 0,10";
Php output: I'm special. Hello 1, Hello 2, Hello 3
How can I write a mysql Query statement to make $ list take effect? Or other query methods with the same effect?
Thank you for writing as much detail as possible.
------ Solution --------------------
You have
$ SQL = "SELECT * FROM table where table. title in ($ list) limit 0, 10 ";
I want you to post
Echo $ SQL;
Results! Is it that hard to get it?