The query below is not returning any results. I have copied it from a query that was working and the only thing different is the addition of the following condition:
WHERE submissionid=$submissionid
Any ideas why this query is not returning any results?
$sqlStr2 = "SELECT
s.loginid
,s.title
,s.url
,s.displayurl
,s.datesubmitted
,l.username
,s.submissionid
,COUNT(c.commentid) countComments
FROM submission s
INNER JOIN login l ON s.loginid = l.loginid
LEFT OUTER JOIN comment c ON s.submissionid = c.submissionid
GROUP BY s.submissionid
WHERE submissionid=$submissionid
ORDER BY s.datesubmitted DESC
LIMIT 10";
$tzFrom2 = new DateTimeZone('America/New_York');
$tzTo2 = new DateTimeZone('America/Phoenix');
$result2 = mysql_query($sqlStr2);
$arr2 = array();
echo "<table class=\"samplesrec\">";
while ($row2 = mysql_fetch_array($result2)) {
$dt2 = new DateTime($row2["datesubmitted"], $tzFrom2);
$dt2->setTimezone($tzTo2);
echo '<tr>';
echo '<td class="sitename1"><a href="http://www.'.$row2["url"].'" TARGET="_blank">'.$row2["title"].'</a> <div class="dispurl">'.$row2["displayurl"].'</div></td>';
echo '</tr>';
echo '<tr>';
echo '<td class="sitename2name">Submitted by <a href="http://www...com/.../members/index.php?profile='.$row2["username"].'">'.$row2["username"].'</a> on '.$dt2->format('F j, Y &\nb\sp &\nb\sp g:i a').'</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="sitename2"><a href="http://www...com/.../comments/index.php?submissionid='.$row2["submissionid"].'">'.$row2["countComments"].' comments</a></td>';
echo '</tr>';
}
echo "</table>";