0

我需要一种方式来表达类似的东西

Mysqli_query("SELECT * FROM table WHERE id.contains('SOME STRING')")

我需要它做的是检索所有相关的字段。

4

3 回答 3

0

i think i might have thought up a solution to this, if anyone else is curious, take the string and create a search for array elements.

于 2013-08-13T02:04:36.960 回答
0

也许 SQL LIKE 查询?

Mysqli_query("SELECT * FROM table WHERE id LIKE '%SOME STRING%'");
于 2013-08-13T02:25:57.193 回答
0
$hresult = mysql_query("SELECT * FROM   `database_name`.`table_name` WHERE `table_name`.`column_name1` = 'variable' AND `table_name`.`column_name2` = 'variable2'");


while($hrow=mysql_fetch_array($hresult)){
    $new_variable= $hrow['column_name'];//

$new_variable2= $hrow['column_name'];//

}
于 2013-08-13T02:30:07.243 回答