Table structure

Installation.

Connection string. I recommend using utf8mb4 else you will not be able to save emoji characters.

Create.

The prepare statement uses DB resources to escape the values, it is heavier but safer. If you know that the values does not require escaping, you can do it with the lighter method.

Read.

Update.

Delete.

Main.

What the main function is doing.
1. Initialize the DB connection.
2. Ping the DB to check if the connection is valid.
3. Insert 2 rows into the table.
4. List all the rows in the table.
5. Update row 1.
6. Delete row 2.
7. List all the rows in the table.

Output.

The full source.

< Back to all the stories I had written

A software engineer, a rock climbing, diving & inline skating enthusiast, a husband, a father.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store