Page 1 of 1

Distinct help......not doing it right

Posted: Thu Feb 12, 2004 3:36 pm
by grudz
whats wrong with this code......its showing me duplicates of question_title??? I wrote the DISTINCT so that i wont have any?


їphp]mysql_select_db($database_cnpa, $cnpa);
$query_forum = "SELECT DISTINCT question_title, name, date, sort_date FROM forum ORDER BY sort_date DESC";
$query_limit_forum = sprintf("%s LIMIT %d, %d", $query_forum, $startRow_forum, $maxRows_forum);
$forum = mysql_query($query_limit_forum, $cnpa) or die(mysql_error());
$row_forum = mysql_fetch_assoc($forum);ї/php]

please!!!!! help
?>

Posted: Sat Feb 14, 2004 1:38 pm
by Weirdan
MySQL manual wrote: The options DISTINCT, DISTINCTROW and ALL specify whether duplicate rows should be returned. The default is (ALL), all matching rows are returned. DISTINCT and DISTINCTROW are synonyms and specify that duplicate rows in the result set should be removed.