Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Introduction
• This worksheet contains further exercises that are intended to familiarise you with PHP Pro-gramming. In particular, we will consider the use of the PHP Data Objects (PDO) extension for accessing databases that is independent of the specific DBMS that is used. This is of-ten preferable over DBMS specific approaches, like the MySQLi extension to access MySQL databases, as it improves the portability of your code.
While you work through the exercises below compare your results with those of your fellow students and ask for help and comments if required.
and you might proceed more quickly if you cut-and-paste code from that PDF file. Note that a cut-and-paste operation may introduce extra spaces into your code. It is important that those are removed and that your code exactly matches that shown in this worksheet.
• The exercises and instructions in this worksheet assume that you use the Department’s Linux systems to experiment with PHP.
If you want to use the Department’s Windows systems instead, then you can do so.
• To keep things simple, we will just use a text editor, a terminal, and a web browser. You can use whatever text editor and web browser you are most familiar or comfortable with.
• If you do not manage to get through all the exercises during this practical session, please complete them in your own time before the next practical takes place.
Exercises
1. Let us start with a number of task relating to the use of MySQL. It is assumed that COMP102 Introduction to Databases (or equivalent) has already familiarised you with MySQL.
a. Open a terminal and connect to the MySQL server using the
command mysql -h mysql <user>
where <user> should be replaced by your departmental user name (<user> indicates which database you want to use).