Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php mysql中的where字段使用变量填充节_Php_Mysql_Field - Fatal编程技术网

Php mysql中的where字段使用变量填充节

Php mysql中的where字段使用变量填充节,php,mysql,field,Php,Mysql,Field,我如何使它(这只是示例)不返回错误 $field_in = this, that $result = mysql_query("SHOW COLUMNS FROM " . $table. " WHERE Field IN ( ".$field_in." )") $field_in=“this,that”;无论如何,实际的错误将帮助我们更好地理解。为此,您必须查询信息\u模式数据库。 $result = mysql_query( "select * from INFORMATI

我如何使它(这只是示例)不返回错误

$field_in = this, that

$result = mysql_query("SHOW COLUMNS FROM " . $table. " WHERE Field IN ( ".$field_in." )")

$field_in=“this,that”;无论如何,实际的错误将帮助我们更好地理解。为此,您必须查询
信息\u模式
数据库。
$result = mysql_query( 
   "select *
    from INFORMATION_SCHEMA.COLUMNS c
    where c.TABLE_SCHEMA = '" . $table. "' 
    and c.COLUMN_NAME IN ( ".$field_in." )")