Question: 2. UPDATE table_01 SET col_02='$user_name' WHERE col_01 = 4: a. Will update all rows. b. Will update one row. c. Will update one row that

2. UPDATE table_01 SET col_02='$user_name' WHERE col_01 = 4:

a. Will update all rows.

b. Will update one row.

c. Will update one row that has col_01 value 4.

d. All the above.

Q5) Write the code to do what has been specified in the comments.

Note: Table 01 shows the table user_account in the database:

Table 01: user_account Table

uid username email password
Int(PK, AI) Varchar(20) varchar(255), Unique varchar(20)

$db_host = "127.0.0.1";

$db_user = "pma";

$db_password = " ";

$db_name = "Library";

$conn = mysqli_connect($db_host, $db_user, $db_password, $db_name);

if(!$conn) {

echo "Debugging errno: " . mysqli_connect_errno();

echo " ";

echo "Debugging error: " . mysqli_connect_error();

exit;

}

$u_id = $_POST['uid'];

//write the query here.

$result = mysqli_query($con, $query);

if($result){

//check if there is a result:

// if there is a result, write a code to dp display the result in a table.

// if there is no result, print: No result has been found. Using proper HTML. } else { //print the following an error has occurred. Using proper HTML.

} else {

//print the following an error has occurred. Using proper HTML.

}

mysqli_close($conn);

?>

Q6) Discuss Session Management.

a. What is it?

b. How to create sessions.

c. How to store data and retrieve data from sessions.

Q7) Discuss Security in terms of:

1. Database safety.

2. User safety.

3. Types of attacks

Q8) When we validate a form, which is better to use JS or PHP? Explain?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!