wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

APPDEV Prelim

Total questions: 20

Worksheet time: 20mins

Name
Class
Date
1.

require './config/db.php' (a)  

2.

$sql = $con->prepare("SELECT * FROM students WHERE stud_id = (a)   ");

3.

$id = (a)   ['student_id'] ?? null;

4.

header("Location: index.php") (a)  

5.

$stmt->execute([":id" _____ $id]);$sql_____execute([":id" => $id]);

(a)  

6.

$con->setAttribute( (a)   ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

7.

} catch (PDOException $e (a)   {

8.

$insert = "INSERT INTO students (stud_fname, stud_mname, stud_lname, stud_email, stud_password) VALUES (:stud_fname,:stud_mname,:stud_lname,:stud_email,:stud_pass)" (a)  

9.

$stmt->execute([" (a)   " => $id]);

10.

$stmt = $con (a)   prepare($sql);

11.

header("Location index.php");

(a)  

12.

$sql = "DELETE FROM students WHERE stud_id = :id" (a)  

13.

$stmt = $con (a)   prepare($insert);

14.

$id = (a)   ['student_id'] ?? null;

15.

while($data = $sql->fetch( (a)   FETCH_ASSOC)) {

16.

header("Location: notfound.php") (a)  

17.

$sql = $con (a)   query("SELECT * FROM students");

18.

$row = $sql->fetch( (a)   FETCH_ASSOC);

19.

header("Location: index.php") (a)  

20.

$stmt = $con (a)   prepare($update);