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
93b70b89
Commit
93b70b89
authored
Dec 01, 2015
by
Sorrel Harriet
Browse files
efforts to untrack files failed
parent
ce805124
Changes
6
Hide whitespace changes
Inline
Side-by-side
week-3/record-store-app/artist.php
0 → 100644
View file @
93b70b89
<?php
/* connect to the database */
$link
=
mysqli_connect
(
'localhost'
,
'sharr003'
,
'password123'
,
'sharr003_recordstore'
);
/* 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
)
?>
week-3/record-store-app/index.php
0 → 100644
View file @
93b70b89
<?php
/* connect to the database */
$link
=
mysqli_connect
(
'localhost'
,
'sharr003'
,
'password123'
,
'sharr003_recordstore'
);
/* check connection succeeded */
if
(
mysqli_connect_errno
())
{
exit
(
mysqli_connect_error
());
}
/* fetch a result set */
$sql
=
"SELECT title, genre FROM record"
;
$result
=
mysqli_query
(
$link
,
$sql
);
/* check query returned a result */
if
(
$result
===
false
)
{
echo
mysqli_error
(
$link
);
}
else
{
// $row_cnt = mysqli_num_rows($result);
// echo $row_cnt
/* fetch associative array */
while
(
$row
=
mysqli_fetch_assoc
(
$result
))
{
echo
(
$row
[
'title'
]
.
" ("
.
$row
[
'genre'
]
.
") "
);
}
/* free result set */
mysqli_free_result
(
$result
);
}
/* close the connection to the database */
mysqli_close
(
$link
)
?>
week-4/record-store-app/includes/db_connect.php
0 → 100644
View file @
93b70b89
<?php
/* Open a new connection to the MySQL server */
/* connect to the database */
$link
=
mysqli_connect
(
'localhost'
,
'sharr003'
,
'password123'
,
'sharr003_recordstore'
);
/* check connection succeeded */
if
(
mysqli_connect_errno
())
{
echo
"Failed to connect to MySQL: "
.
mysqli_connect_error
();
}
?>
week-5/record-store-app/includes/db_connect.php
0 → 100644
View file @
93b70b89
<?php
/* Open a new connection to the MySQL server */
/* connect to the database */
$link
=
mysqli_connect
(
'localhost'
,
'sharr003'
,
'password123'
,
'sharr003_recordstore'
);
/* check connection succeeded */
if
(
mysqli_connect_errno
())
{
echo
"Failed to connect to MySQL: "
.
mysqli_connect_error
();
}
?>
week-6/record-store-app/includes/db_connect.php
0 → 100644
View file @
93b70b89
<?php
/* Open a new connection to the MySQL server */
/* connect to the database */
$link
=
mysqli_connect
(
'localhost'
,
'sharr003'
,
'password123'
,
'sharr003_recordstore'
);
/* check connection succeeded */
if
(
mysqli_connect_errno
())
{
echo
"Failed to connect to MySQL: "
.
mysqli_connect_error
();
}
?>
week-8/record-store-app/includes/db_connect.php
0 → 100644
View file @
93b70b89
<?php
/* Open a new connection to the MySQL server */
/* connect to the database */
$link
=
mysqli_connect
(
'localhost'
,
'sharr003'
,
'password123'
,
'sharr003_recordstore'
);
/* check connection succeeded */
if
(
mysqli_connect_errno
())
{
echo
"Failed to connect to MySQL: "
.
mysqli_connect_error
();
}
?>
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