help with query

From: Date: Thu, 07 Jun 2012 16:37:19 +0000
Subject: help with query
Groups: php.general 
Request: Send a blank email to php-general+get-318181@lists.php.net to get a copy of this message
Hello All, I have this string defined for my query and it shows the different types of categories fine, but when I change a.categoryid = c.categoryid to a.categoryid = 1 which is only one of the categories It shows me the same record twice. $query = "select a.startdate, a.articleid, c.name, a.title, a.intro, a.datecreated from articles as a, categories as c where (a.startdate = -1 or a.startdate <= {$now}) and (a.enddate = -1 or a.enddate >= {$now}) and a.categoryid = c.categoryid order by a.startdate DESC"; while ( $row = mysql_fetch_array($res) ) { $tpldata['articles'][] = array( 'title' => $row['title'], 'intro' => makeLinks($row['intro']), 'id' => $row['articleid'], 'categoryname' => $row['name'], 'created' => date('n/j/Y', $row['datecreated']) ); //echo $row['datecreated']; } Any Ideas??? Thanks!

« previous php.general (#318181) next »