$query = mysql_query("SELECT c.id as cid,c.is_update as cis,u.* FROM table1 c,table2 u WHERE c.id='$id' OR (u.id=c.is_update AND c.id='$id')"); |
השאילתא לא נותנת תוצאה מדוייקת
בקטע של ה-AND
אבל אם היה נעשה שימוש בשאילתה כזאת:
$query = mysql_query("SELECT c.id as cid,c.is_update as cis,u.* FROM table1 c,table2 u WHERE u.id=c.is_update AND c.id='$id'"); |
הייתה מתקבלת תוצאה טובה אבל לא תתקבל תוצאה במקרה שבו
uid שונה מ c.is_update