Question
Table Name: STUDENT snum sname course year gender bdate 200912345 Angus Maximus Information Technology 3 M 1993-05-04 200912333 Prism Queen Information Technology 3 F 1994-02-07
Table Name: STUDENT
snum | sname | course | year | gender | bdate |
200912345 | Angus Maximus | Information Technology | 3 | M | 1993-05-04 |
200912333 | Prism Queen | Information Technology | 3 | F | 1994-02-07 |
200820111 | Ice Crown | Computer Science | 4 | F | 1992-08-01 |
200811101 | Valesti Knight | Information Technology | 4 | M | 1992-06-08 |
201035600 | Surge Seoul | Computer Science | 2 | M | 1995-09-12 |
201055558 | Dark Savior | Computer Engineering | 0 |
| 1994-12-04 |
201165844 | PyrusLyllwin | Computer Science | 1 | F | 1995-10-10 |
What's the output of the codes below?
1. $q = mysql_query("SELECT COUNT(year) FROM student"); $r = mysql_result($q,0); -or- $q = mysqli_query("SELECT COUNT(year) FROM student", $dbconnect); $r = mysqli_result($q,0);
6
7
8
error
2. What is the output of the code below? $q = mysql_query("SELECT COUNT(gender) FROM student"); $r = mysql_result($q,0); -or- $q = mysql_query("SELECT COUNT(gender) FROM student"); $r = mysql_result($q,0);
6
7
8
error
3. What is the output of the code below? $q = mysql_query("SELECT COUNT(gender) FROM student WHERE gender='M'"); $r = mysql_affected_rows(); echo $r; -or- $q = mysqli_query("SELECT COUNT(gender) FROM student WHERE gender='M'", $dbconnect); $r = mysqli_affected_rows(); echo $r;
4
3
2
1
4. What is the output of the code below? $q = mysql_query("SELECT COUNT(year) FROM student"); $r = mysql_num_rows($q); -or- $q = mysqli_query("SELECT COUNT(year) FROM student", $dbconnect); $r = mysqli_num_rows($q);
6
7
8
error
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started