이 오류가 계속 발생하지만 부적절한 구문은 볼 수 없지만 어떤 아이디어가 있습니까? 여기에 제 PHP 코드가 있습니다. 다른 모든 페이지가 문제없이 코드를 실행할 수 있으므로 다른 페이지도 정확하다는 것을 알고 있습니다.오류 : SQL 구문에 근처에 '1'에있는 오류가 있습니다.
<?php
// this connects To database
$hostname="";
$username="";
$password="";
$dbname="";
mysql_connect($hostname,$username,$password) OR DIE ("Connection Failed");
mysql_select_db($dbname);
$action = $_REQUEST["action"];
if ($action == 'a') {
$custFirst = null;
$custLast = null;
$custAddress = null;
$custCity = null;
$custState = null;
$custZip = null;
$custEmail = null;
$custPhone = null;
} else {
$id = $_REQUEST["id"];
$query = "select * from custTab where custNo = $id";
$result = mysql_query($query)
or die(mysql_error());
$row = mysql_fetch_array($result);
$custFirst = $row['custFirst'];
$custLast = $row['custLast'];
$custAddress = $row['custAddress'];
$custCity = $row['custCity'];
$custState = $row['custState'];
$custZip = $row['custZip'];
$custEmail = $row['custEmail'];
$custPhone = $row['custPhone'];
} // end if
?>
'echo $ query;'와 출력을 보여주세요. – MichaelRushton
SQL 주입을 조심하십시오! – Wiseguy
'$ _REQUEST [ "id"]'가 설정되어 있습니까? – Sirko