こんにちは、私は PHP の初心者です。今日は午前中ずっと問題に悩まされていました。よろしくお願いします。
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><!DOCTYPE html> <html> <head> <title>Book-O-Rama Book Entry Results</title> <style type="text/css"> </style> <script type="text/javascript"></script> <script> </script> </head> <body> <h1>Book-O-Rama Book Entry Result</h1> <?php //create short variable names $isbn = $_POST['isbn']; $author = $_POST['author']; $title = $_POST['title']; $price = $_POST['price']; if ( !$isbn || !$author || !$title || !$price ) { echo "You have not entered all the required details.<br/>"."Please go back and try again."; exit; } if ( !get_magic_quotes_gpc() ) { $isbn = addslashes($isbn); $author = addslashes($author); $title = addslashes($title); $price = doubleval($price); } @ $db = new mysqli('localhost', 'bookorama', 'bookorama123', 'books'); if ( mysqli_connect_errno() ) { echo "Error: Could not connect to database. Please try again later."; exit; } $query = "insert into books values ('$isbn', '$author', '$title', '$price')or die(mysql_error())"; ; echo $query; $result = $db->query($query); if ( $result ) { echo mysqli_affected_rows." book inserted into database."; } else { echo mysql_errno()."".mysql_error(); echo "An error has occurred.The item was not added."; } $db->close(); ?> </body> </html>