Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SELECT fname, sname, email FROM student WHERE contact_flag='Yes' AND sno!='$lastid'
如何以不选择链接到 $lastid 的数据并因此检索其他数据的方式重写此查询?已经为此苦苦挣扎了一段时间,我无法弄清楚。请帮帮我!
试试这个,完全未经测试
SELECT fname, sname, email FROM student WHERE contact_flag='Yes' AND sno NOT IN (SELECT sno FROM student WHERE sno='$lastid')
您在单引号内使用 php 变量。试试“$lastid”。希望这会有所帮助。