【发布时间】:2011-05-16 08:07:22
【问题描述】:
我正在尝试从其标签(数组)类似于给定值的数据库中检索所有数据 id。 这就是我到目前为止所做的......
$new_string = 'nice phone';
$construct = mysql_query("SELECT tag_array, name, id FROM details
WHERE tag_array LIKE $new_string%")
or die("<p>died 20: $construct<br>" . mysql_error());
while($getThis = mysql_fetch_array($construct)){
echo $getThis['id'].'<br />';
echo stripslashes($getThis['name']).'<br />';
}
它根本不起作用。 你能指出我正确的方向吗? 我真的好难受!!
【问题讨论】:
-
“它根本不起作用。”那么会发生什么呢?
-
我加了单引号,抱歉打错了。它与数组中的所有单词都不匹配。在第一个词上。关于如何解决这个问题的任何想法?
标签: php mysql arrays while-loop sql-like