Access Millions of academic & study documents

Briefly explain line by line what this PHP code will do Explain in t

Content type
User Generated
Showing Page:
1/13
Briefly explain line by line what this PHP code will do.
Explain in the space under each line
Solution
Answer
<html>
<head>
<title>View Records</title>
<meta http-equiv=\"Content-Type\" content=\"text/html;
</head>
<body>
<h1>View Records</h1>
<p><b>View All</b>
<?php
// connect to the database
include(\'connect-db.php\');
// get the records from the database
if ($result = $mysqli->query(\"SELECT * FROM players
ORDER BY id\"))
{
// display records if there are records to display
if ($result->num_rows > 0)

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/13
{
// display records in a table
echo \"<table border=\'1\' cellpadding=\'10\'>\";
// set table headers
echo
\"<tr><th>ID</th><th>Name</th><th>password</th><th></t
h><th></th></tr>\";
while ($row = $result->fetch_object())
{
// set up a row for each record
echo \"<tr>\";
echo \"<td>\" . $row->id . \"</td>\";
echo \"<td>\" . $row->name . \"</td>\";
echo \"<td>\" . $row->password . \"</td>\";
echo \"<td><a href=\'records.php?id=\" . $row->id .
\"\'>Edit</a></td>\";
echo \"<td><a href=\'delete.php?id=\" . $row->id .
\"\'>Delete</a></td>\";
echo \"</tr>\";
}
echo \"</table>\";
}
// if there are no records in the database, display an alert
message
else

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/13

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 13 pages?
Access Now
Unformatted Attachment Preview
Briefly explain line by line what this PHP code will do. Explain in the space under each line Solution Answer View Records ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4