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
549ae60e
Commit
549ae60e
authored
Oct 30, 2015
by
Sorrel Harriet
Browse files
No longer required
parent
e66055a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
week-5/record-store-app/views/artists.php
deleted
100644 → 0
View file @
e66055a4
<?php
// create variable for content HTML
$content
=
"<h1>Artists</h1>"
;
// fetch records as a result set
$sql
=
"SELECT first_name, last_name FROM artist"
;
$result
=
mysqli_query
(
$link
,
$sql
);
// check query returned a result
if
(
$result
===
false
)
{
echo
mysqli_error
(
$link
);
}
else
{
$content
.
=
"<table border='1'><tbody>"
;
// fetch associative array
while
(
$row
=
mysqli_fetch_assoc
(
$result
))
{
$content
.
=
"<tr>"
;
$content
.
=
"<td>"
.
$row
[
'first_name'
]
.
"</td>"
;
$content
.
=
"<td>"
.
$row
[
'last_name'
]
.
"</td>"
;
$content
.
=
"</tr>"
;
}
$content
.
=
"</tbody></table>"
;
// free result set
mysqli_free_result
(
$result
);
}
// output the content HTML
echo
$content
;
?>
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