なぜこれが何をしているのか?
コード:
<?php
if (isset($_POST['sourceInsert'])) {
$url = $db_con3->real_escape_string($_POST['url']);
$desc = $db_con3->real_escape_string($_POST['desc']);
echo '$urlbefore is ' . $url . '<br />'; ///for troubleshooting
$result = $db_con3->query("INSERT INTO gdrive_links (evalid, userid, url, desc) VALUES ('$evalid', '$id', '$url', '$desc')");
echo '$urlafter is ' . $url . '<br />'; ///For troubleshooting
echo $db_con3->error; ///For troubleshooting
}
?>
HTML 出力:
$urlbefore is https://docs.google.com/file/d/0B0tcjQ3FxlB6dWlMTkNQVjBwVDA/edit?usp=sharing
$urlafter is https://docs.google.com/file/d/0B0tcjQ3FxlB6dWlMTkNQVjBwVDA/edit?usp=sharing
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 'desc) VALUES ('1284017', '1', 'https://docs.google.com/file/d/0B0tcjQ3FxlB6dWlMT' at line 1
そのため、クエリ文字列の前後の文字列は問題ありませんが、クエリでは 49 文字目で途切れています。私は愚かな何かを逃していますか?私のクエリ構文は正しいようです...