이 오류가 계속 발생하면서 문법이 옳다는 것이 매우 긍정적입니다!이 코드에 어떤 오류가 있습니까?
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '='00001010'' at line 1
PHP 코드 :
<?php
$decode = str_split($_POST['ascii'], 8);
mysql_connect("localhost","Username","Password");
mysql_select_db("information");
foreach($decode as $char){
$query = mysql_query("SELECT * FROM ascii_binary WHERE binary='$char'") or die(mysql_error());
while ($row = mysql_fetch_array($query)) {
$char = $row['character'];
echo $char;
}
}
?>
'binary'는 예약어이며 쿼리에서 사용하는 동안은 역 따옴표에 포장 할 필요가 -words.html –