salve a tutti
anche io ho lo stesso problema. non riesco a far comparire un messaggio di errore se la query restituisce un risultato vuoto
questo č il codice
Codice:
$sql = "SELECT
pt.topic_id, pt.topic_title
FROM ". TOPICS_TABLE." pt
WHERE pt.topic_title like '$key'
ORDER BY pt.topic_id";
$db->sql_query($sql);
$result = $db->sql_query($sql);
if (mysql_num_rows($result) == 0 )
{
trigger_error('NO_SEARCH_RESULTS');
}
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('cerca_list', array(
'TOPIC_ID' => $row['topic_id'],
//'POST_ID' => $row['post_id'],
'TOPIC_TITLE' => $row['topic_title'],
'TOPIC_LINK' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't='.$row['topic_id']),
//'POST_AUTHOR' => $row['username'],
));
}
si tratta di una semplice query di ricerca all'interno di uno script phpbb3
grazie a tutti