这似乎是一个简单的错误,但我完全被卡住了。这是代码:
if (!empty ($_POST['searchbird'])){
$searchbird=rawurlencode(trim($_POST['searchbird']));
$result = mysql_query("SELECT `sciname` FROM `wp_birds` WHERE $searchbird = `comname`");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$searchterm = mysql_fetch_row($result);
SQL 数据库设置 Col 4 是 comname,col 5 是 sciname
这是错误无法运行查询:'where 子句'中的未知列'this is the searchterm'