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
Ifrah Shahid
lab-exercises
Commits
cc350ddd
Commit
cc350ddd
authored
Nov 04, 2016
by
Sorrel Harriet
Browse files
removing old artist script
parent
ad6e8894
Changes
1
Hide whitespace changes
Inline
Side-by-side
lab-5/music-store-app/artist.php
deleted
100755 → 0
View file @
ad6e8894
<?php
/* connect to the database */
$link
=
mysqli_connect
(
'localhost'
,
'YOUR_USERNAME'
,
'YOUR_PASSWORD'
,
'YOUR_DB_NAME'
);
/* check connection succeeded */
if
(
mysqli_connect_errno
())
{
exit
(
mysqli_connect_error
());
}
/* fetch 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
{
/* fetch associative array */
while
(
$row
=
mysqli_fetch_assoc
(
$result
))
{
echo
(
$row
[
'first_name'
]
.
" ("
.
$row
[
'last_name'
]
.
") "
);
}
/* free result set */
mysqli_free_result
(
$result
);
}
/* close the connection to the database */
mysqli_close
(
$link
)
?>
\ 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