Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Arvin Ababao
lab-exercises
Commits
7d8cbbf1
Commit
7d8cbbf1
authored
Nov 18, 2015
by
Sorrel Harriet
Browse files
correcting use of sprintf
parent
8a179af8
Changes
1
Hide whitespace changes
Inline
Side-by-side
week-6/record-store-app/views/add-record.php
View file @
7d8cbbf1
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment