Ben 3 sql tablolar var:
qotwQuestion1a(QuestionId [primarykey], Question, MemberId, PostDate);
qotwVote1a (QuestionId [primarykey], MemberId [primarykey], Vote1a);
qotwMember (MemberId [primarykey], Name, Password, emailId);
Ben geçen hafta en yüksek oy hakkı vardır Soru QuetionId ve MemberId bulmak için bir sql sorgu yazmak istiyorum. Ben php bu sorguyu yazdım, ama bana yanlış sonuç verir:
$result6 = mysql_query("SELECT MAX(Vote1a) AS highestVote, * FROM qotwMember, qotwQuestion1a , qotwVote1a
WHERE qotwMember.MemberId=qotwQuestion1a.MemberId
AND qotwQuestion1a.QuestionId=qotwVote1a.QuestionId
AND qotwQuestion1a.MemberId=qotwVote1a.MemberId
AND PostDate>='".$startofweek."' AND PostDate<='".$endofweek."'
ORDER BY qotwQuestion1a.QuestionId DESC ");
while($row6 = mysql_fetch_array($result6))
{
echo "The highest voted question of the last week is: "; echo $row6['highestVote']; echo $row6['MemberId'] . " " . $row6['Name'] . " " . $row6['Password'] . " " . $row6['PostDate'] . " " . $row6['Question']." ".$row6['QuestionId']." ".$row6['Vote1a'];
echo "<br />";
}
$startofweek
ve $endofweek
geçen hafta son haftası ve sonu başında tarih verin.
Birisi, bu bana lütfen yardımcı olabilir.
Best Zeeshan