[solved]-Anyone Help Questions 5 6 Third Time M Posting Question M Stucked Question Ve Attached Sql Q39033445
Can anyone help me with questions 5 & 6. This is thethird time I’m posting this question. I’m stucked with thisquestion. I’ve attached sqltest.php code Which should be changed toget the output as in figure 2. This is from WWW Info sysdev.
<?php // sqltest.php require_once ‘login.php’; $conn = new mysqli($hn, $un, $pw, $db); if ($conn->connect_error) die($conn->connect_error); if (isset($_POST[‘delete’]) && isset($_POST[‘isbn’])) { $isbn = get_post($conn, ‘isbn’); $query = “DELETE FROM classics WHERE isbn=’$isbn'”; $result = $conn->query($query); if (!$result) echo “DELETE failed: $query<br>” . $conn->error . “<br><br>”; } if (isset($_POST[‘author’]) && isset($_POST[‘title’]) && isset($_POST[‘category’]) && isset($_POST[‘year’]) && isset($_POST[‘isbn’])) { $author = get_post($conn, ‘author’); $title = get_post($conn, ‘title’); $category = get_post($conn, ‘category’); $year = get_post($conn, ‘year’); $isbn = get_post($conn, ‘isbn’); $query = “INSERT INTO classics VALUES” . “(‘$author’, ‘$title’, ‘$category’, ‘$year’, ‘$isbn’)”; $result = $conn->query($query); if (!$result) echo “INSERT failed: $query<br>” . $conn->error . “<br><br>”; } echo <<<_END <form action=”sqltest.php” method=”post”><pre> Author <input type=”text” name=”author”> Title <input type=”text” name=”title”> Category <input type=”text” name=”category”> Year <input type=”text” name=”year”> ISBN <input type=”text” name=”isbn”> <input type=”submit” value=”ADD RECORD”> </pre></form>_END; $query = “SELECT * FROM classics”; $result = $conn->query($query); if (!$result) die (“Database access failed: ” . $conn->error); $rows = $result->num_rows; for ($j = 0 ; $j < $rows ; ++$j) { $result->data_seek($j); $row = $result->fetch_array(MYSQLI_NUM); echo <<<_END <pre> Author $row[0] Title $row[1] Category $row[2] Year $row[3] ISBN $row[4] </pre> <form action=”sqltest.php” method=”post”> <input type=”hidden” name=”delete” value=”yes”> <input type=”hidden” name=”isbn” value=”$row[4]”> <input type=”submit” value=”DELETE RECORD”></form>_END; } $result->close(); $conn->close(); function get_post($conn, $var) { return $conn->real_escape_string($_POST[$var]); }?>

5- Change sqltest.php to print the classics rows as html table with the header as seen in Figure2, point your file to the external table.css file. Add a checkbox for each row to be selected for deletion. The red-highlighted checkbox is check/uncheck all checkboxes that call a JavaScript function with check_all0 to sqltest.php where all selected (checked rows) will be deleted 6- check_all function must be implemented in checkboxes.js file, checkboxes.js must be stored and access from js folder 7- As usual in the previous assignments, please submit sqltest.php link from your domain on myweb, failure to submit the correct link will lead to marks deduction this name. Delete buttons will redirect you back time! Author Title Category Year ISBN ADD RECORD Delete Author Mark Twain Title Category Year Title 1876 9781598184891 The Adventures of Tom Sawyer Fiction Pride and Prejudice Jane Austen Charles Darwin Charles Dickens William Shakespeare Romeo and Juliet 1811 9780582506206 Fiction The Origin of Species The Old Curiosity Shop Non-Fiction 1856 9780517123201 Fiction Play 1841 9780099533474 1594|9780192814968| Figure 2: the assignment has to look like this figure || 미미미[ Show transcribed image text 5- Change sqltest.php to print the classics rows as html table with the header as seen in Figure2, point your file to the external table.css file. Add a checkbox for each row to be selected for deletion. The red-highlighted checkbox is check/uncheck all checkboxes that call a JavaScript function with check_all0 to sqltest.php where all selected (checked rows) will be deleted 6- check_all function must be implemented in checkboxes.js file, checkboxes.js must be stored and access from js folder 7- As usual in the previous assignments, please submit sqltest.php link from your domain on myweb, failure to submit the correct link will lead to marks deduction this name. Delete buttons will redirect you back time! Author Title Category Year ISBN ADD RECORD Delete Author Mark Twain Title Category Year Title 1876 9781598184891 The Adventures of Tom Sawyer Fiction Pride and Prejudice Jane Austen Charles Darwin Charles Dickens William Shakespeare Romeo and Juliet 1811 9780582506206 Fiction The Origin of Species The Old Curiosity Shop Non-Fiction 1856 9780517123201 Fiction Play 1841 9780099533474 1594|9780192814968| Figure 2: the assignment has to look like this figure || 미미미[
Expert Answer
Answer to Can anyone help me with questions 5 & 6. This is the third time I’m posting this question. I’m stucked with this qu… . . .
OR

