2011-12-26 67 views
0

我仍然獲得轉義「在我的數據庫下面是我的代碼:php的mysql_real_escape_string不起作用?

$connection=mysql_connect ('localhost', $username, $password); 

if (!$connection) { 

    die('Not connected : ' . mysql_error()); 

} 
$name = mysql_real_escape_string($name); 
$address = mysql_real_escape_string($address); 
$number = mysql_real_escape_string($number); 
mysql_query("INSERT INTO people (name, area, phone) 
VALUES ('$name', '$address', '$number')"); 

} 

什麼是錯在這裏

回答

1

什麼是錯在這裏

可能沒什麼mysql_real_escape_string()逃脫字符串數據?。僅在插入的時候,數據在數據庫內部的數據看起來沒有變化,這是它的意思。

你的代碼看起來很好(除了你不是checking the query for errors,你想這樣做,你可以調試問題。)

+0

哦,不錯,不知道..謝謝@Pekka – Tom 2011-12-26 14:26:09