Commit 7d8cbbf1 authored by Sorrel Harriet's avatar Sorrel Harriet

correcting use of sprintf

parent 8a179af8
......@@ -89,7 +89,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
// define the insertion query
$sql = sprintf("INSERT INTO record (ean, title, artist_id, genre, year, price)
VALUES (%d, %d, %d, %d, %d, %d)", $ean, $title, $artist_id, $genre, $year, $price);
VALUES ('%s', '%s', %d, '%s', %d, %f)", $ean, $title, $artist_id, $genre, $year, $price);
// run the query to insert the data
$result = mysqli_query($link, $sql);
......@@ -107,4 +107,4 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
// output the html
echo($content);
?>
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment