我已经坚持了一段时间,我知道非常初学者,但找不到任何类似的问题。
我正在尝试显示我上一个主题的详细信息,但我收到了警告。
*Warning: pg_exec() [<a href='function.pg-exec'>function.pg-exec</a>]:
Query failed:
ERROR: operator does not exist: character varying = integer LINE 4: WHERE
t_cat = 3 ^
HINT: No operator matches the given name and argument type(s). You
might need to add explicit type casts.*
任何帮助表示赞赏
$topicsearh = pg_exec($db,
"SELECT t_id, t_subject, t_date, t_cat
WHERE t_cat = " . $row['s_id'] . "
ORDER BY t_date DESC LIMIT 1"
);
if(!$topicsearh){
echo 'Last topic could not be displayed.';
}
else{
while($trow = pg_fetch_assoc($topicsearh))
echo '<a href="topicview.php?id=' . $trow['t_id'] . '">' . $trow['t_subject'] .
'</a> at ' . date('d-m-Y', strtotime($trow['t_date']));
}