我想阻止1 = 1使用mysql_real_escape_string,但不知道如果即時通訊正確,因爲我仍然可以執行1 = 1。這是我的代碼:MySQL注入預防不起作用?
$memberId = mysql_real_escape_string($_GET["memberId"]);
$sql = "SELECT firstName, lastName, dateSent, message, messageId FROM member, message WHERE member.memberId = message.sentFromId AND message.inboxId=" . $memberId . " ORDER BY dateSent DESC;";
感謝
我已經在[MySQL/PDO/Prepared Statements中解釋過整個問題 - 所有的跳躍,有點壓倒性和有點混亂?](http://stackoverflow.com/questions/8061185/mysql-pdo- prepared-statements-all-a-big-jump-a-bit-over-a-lit) –