HOW THE QUIZ WORKS:
Clicking the ‘randomize’ button situated above the reference table generates a new table whereby the function descriptions, function syntaxes, and function return values are randomized. The quiz involves matching the function descriptions, function syntaxes, and function return values to the correct function name. Information relating to the randomization of table cells will be displayed for three seconds, before disappearing.
On a desktop computer, table elements are selected by left-clicking the desired table cell and holding the left click in the mouse down position for one second before releasing the left click. The text inside the table cell will turn red to indicate that the one-second mouse left-click has successfully selected a table cell. To then swap the selected table cell with the target table cell, simply repeat the one-second left mouse-click process on the target cell; the table cells will swap position. To de-select a table cell, simply repeat the one-second left mouse-click process on the original table cell.
To select a table element on a touchscreen device (mobile, tablet), simply touch the desired table cell and maintain the touch for one second before removing your finger from the screen. The text inside the table cell will turn red to indicate that the one-second touch has successfully selected a table cell. To then swap the selected table cell with the target table cell, simply repeat the one-second touch process on the target cell; the table cells will swap position. To de-select a table cell, simply repeat the one-second touch process on the original table cell.
Normal touchscreen scrolling behaviour is exhibited by the cells with a light green background; cells without a light green background will not respond to normal touchscreen scrolling. The table is positioned in such a way that the user can also initiate touchscreen scrolling by swiping to the right or left of the table.
When a row consists of the correct function name, function description, function syntax, and function return value, the background colour of the row will change from ‘transparent’ to ‘khaki’; this provides visual feedback that the row is complete.
Once the entire table is complete, a paragraph of feedback will congratulate the user and provide the following information: date and time of quiz commencement; date and time of quiz completion; and the length of time it took the user to complete the quiz.
VIEWPORT OPTIONS:
PURPOSE:
This webpage serves two purposes:
- It provides a reference table for the PHP MySQLi functions, with information extracted and condensed from w3schools.com and php.net.
- It enables users to complete a quiz related to the PHP MySQLi functions.
USAGE:
For each PHP MySQLi function there are four table cells of information: the function name; the function description; the function syntax; and the function return value. There are three layouts available – ‘mobile‘, ‘tablet‘, and ‘desktop‘.
Click the relevant button below to display the PHP MySQLi functions reference table, sized appropriately for the desired viewport. A ‘RANDOMIZE‘ button appears above the reference table once the viewport is selected; clicking this button facilitates the commencement of a quiz.
Click the ‘RANDOMIZE‘ button to randomize the functional descriptions, the functional syntaxes, and the functional return information.
| FUNCTION NAME | FUNCTION DESCRIPTION | FUNCTION SYNTAX | FUNCTION RETURN VALUE |
|---|---|---|---|
mysqli::$host_info()mysqli_get_host_info()
[mysqli::$host_info — mysqli_get_host_info – Returns a string representing the type of connection used] |
This function returns a string describing (‘giving information about’) the connection represented by $mysqli [object-oriented]/mysqli_link [procedural] (including the server host name). | Object-oriented style:$mysqli->host_info;
Procedural style: [mysqli_link: a link identifier returned by |
mysqli::$host_info(): returns a character string representing the server hostname and the connection type. |
mysqli::$protocol_version()mysqli_get_proto_version()
[mysqli::$protocol_version — mysqli_get_proto_version – Returns the version of the MySQL protocol used] |
This function returns an integer representation of the MySQL protocol version used by the connection represented by the $mysqli [object-oriented]/mysqli_link [procedural] parameter. | Object-oriented style:$mysqli->protocol_version;
Procedural style: [mysqli_link: a link identifier returned by |
mysqli::$protocol_version(): returns an integer representation of the protocol version. |
mysqli::$server_info()mysqli::get_server_info()mysqli_get_server_info()
[mysqli::$server_info — mysqli::get_server_info — mysqli_get_server_info – Returns the version of the MySQL server] |
This function returns a string representation of [‘information about’] the MySQL server version that the MySQLi extension is connected to. | Object-oriented style – flavour one:$mysqli->server_info;
Object-oriented style – flavour two: Procedural style: [mysqli_link: a link identifier returned by |
mysqli::$server_info(): returns a character string representing the MySQL server version. |
mysqli::$server_version()mysqli_get_server_version()
[mysqli::$server_version — mysqli_get_server_version – Returns the version of the MySQL server as an integer] |
This function returns the version of the server connected to [represented by $mysqli (object-oriented style) / mysqli_link (procedural style)] as an integer. | Object-oriented style:$mysqli->server_version;
Procedural style: [mysqli_link: a link identifier returned by |
mysqli::$server_version(): returns an integer representation of the MySQL server version. This integer representation takes the following form: main_version * 10000 + minor_version * 100 + sub_version (thus, version 4.1.0 is returned as 40100). |
mysqli::get_warnings()mysqli_get_warnings()
[mysqli::get_warnings — mysqli_get_warnings – Get result of SHOW WARNINGS] |
This function returns [‘gets’] an array of mysqli warnings. Each warning object has three properties: message, sqlstate, and errno. The array can be traversed using the next() function of the mysqli_warning class. |
Object-oriented style:$mysqli->get_warnings();
Procedural style: [mysqli_link: a link identifier returned by |
mysqli::get_warnings(): returns an array of mysqli warning objects; this array can be navigated using the next() function of the mysqli_warning class. |
mysqli::$info()mysqli_info()
[mysqli::$info — mysqli_info – Retrieves information about the most recently executed query] |
This function returns an informative string about the most recently executed mysqli query. For queries of the form INSERT INTO...SELECT/INSERT INTO...VALUES (...),(...),(...)/ALTER TABLE..., the returned string is of the form Records: #, Duplicates: #, Warnings: #. Where the query is of the form LOAD DATA INFILE..., the returned string is of the form Records: #, Deleted: #, Skipped: #, Warnings: #. For queries of the form UPDATE..., the returned string is of the form Rows Matched: #, Changed: #, Warnings: #. |
Object-oriented style:$mysqli->info;
Procedural style: [mysqli_link: a link identifier returned by |
mysqli::$info(): returns a character string representing additional information about the most recently executed query. Queries that are not of the form INSERT INTO...SELECT / INSERT INTO...VALUES (...),(...),(...) / ALTER TABLE... / LOAD DATA INFILE... / UPDATE... are not supported, and will return an empty string. |
mysqli::init()mysqli_init()
[mysqli::init — mysqli_init – Initializes MySQLi and returns a resource for use with mysqli_real_connect()] |
This function allocates or initializes a MySQL object suitable for use in conjunction with the mysqli_options() and mysqli_real_connect() functions. With the exception of mysqli_options(), subsequent calls to any MySQLi function will fail until mysqli_real_connect() is called. |
Object-oriented style:$mysqli->init();
Procedural style: |
mysqli::init(): returns a MySQL object. |
mysqli::$insert_id()mysqli_insert_id()
[mysqli::$insert_id — mysqli_insert_id – Returns the auto generated ID used in the latest query] |
This function returns the ID generated by a query (usually INSERT) on a table with a column having the AUTO INCREMENT attribute. If no INSERT or UPDATE statements were sent via this connection, or if the modified table does not have a column with the AUTO-INCREMENT property, this function returns 0. |
Object-oriented style:$mysqli->insert_id;
Procedural style: [mysqli_link: a link identifier returned by |
mysqli::$insert_id(): returns the value of the AUTO_INCREMENT field that was updated by the previous query. Returns zero if the query did not update an AUTO_INCREMENT field, or if there was no previous query on the connection. If the maximal int value is exceeded, a string will be returned instead. |
mysqli::kill()mysqli_kill()
[mysqli::kill — mysqli_kill – Asks the server to kill a MySQL thread] |
This function is used to ask the server to kill a MySQL thread. The processid parameter specifies which MySQL thread to kill. The processid value must be obtained by calling the mysqli_thread_id() function. The SQL command KILL QUERY processid should be used to stop a running query. |
Object-oriented style:$mysqli->kill(processid);
Procedural style: [processid: specifies which MySQL thread to kill. |
mysqli::kill(): returns TRUE on success; FALSE on failure. |
mysqli::more_results()mysqli_more_results()
[mysqli::more_results — mysqli_more_results – Check if there are any more query results from a multi query] |
This function is used to indicate if one or more result sets are available from a previous call to mysqli_multi_query(). |
Object-oriented style:$mysqli->more_results();
Procedural style: [mysqli_link: a link identifier returned by |
mysqli::more_results(): returns TRUE if one or more result sets are available from a previous call to mysqli_multi_query(); otherwise FALSE. |

