PHP Quickstart
This repository contains a simple web application that demonstrates how to quickly connect to and communicate with a MariaDB database using PHP (via mysqli).
⚠️ Interested in using MariaDB and PHP with PDO (PHP Data Objects)? Check out the quickstart here!
Getting Started
The application in this repository demonstrates how to:
- Connect to a MariaDB database using
mysqli
- Execute queries (
SELECT
,UPDATE
,INSERT
andDELETE
) to manage contact data (like a digital rolodex) - Use prepared statements
Prepare the database
The application relies on a single database (rolodex
) that contains a single table (contacts
). You can find the necessary SQL for setting up the environment in schema.sql.
Run the application
After you've pulled down this repository, follow these steps to get the app up and running:
-
Update the database configuration settings in config.php (which is used across the app) to point to your MariaDB database.
Example configuration:
$databaseHost = '127.0.0.1'; $databaseUsername = 'user_name'; $databasePassword = '********'; $databaseName = 'rolodex';
Note: Check out the config_skysql.php file for an example of how to connect to MariaDB SkySQL.
-
Run the application using the built-in web server.
$ php -S localhost:5000
Helpful Resources
Support and Contribution
Please feel free to submit PR's, issues or requests to this project directly.
If you have any other questions, comments, or looking for more information on MariaDB please check out:
Or reach out to us directly via: