我有下面的SQL語句..MYSQL聲明不正確呼應
$sql = "select tableid, comment, ID, description from reservations
where uniqueid = '" . $reservationid . "'";
$ ReservationId爲通過POST形式通過。選擇不同字段的非常類似的聲明似乎在另一頁上正常工作。但是,當我回聲頁面上的SQL語句,我得到
select tableid, comment, ID, description
from reservations
where uniqueid = '51e5f949c1828'
這似乎跳過最後的單引號
我也試過
$sql = "select tableid, comment, ID, description from reservations
where uniqueid = '$reservationid'";
具有相同的結果。如果我查看網頁源代碼,我不明白爲什麼我看到這個..
select tableid, comment, ID, description from reservations
where uniqueid = '51e5f949c1828</form
在地球上是流浪</form>
部分來自哪裏?
你可以發佈示例代碼 – 2013-08-01 10:59:04
您應該使用*預處理語句*畢竟。 –
發佈您的代碼。在sql中沒有錯誤。您可能還沒有以 –