Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielwte/php-user-crud-example
Source code for a PHP CRUD app connecting to a MySQL database.
https://github.com/danielwte/php-user-crud-example
Last synced: 22 days ago
JSON representation
Source code for a PHP CRUD app connecting to a MySQL database.
- Host: GitHub
- URL: https://github.com/danielwte/php-user-crud-example
- Owner: DanielWTE
- Created: 2024-05-26T15:54:13.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-03T17:57:25.000Z (7 months ago)
- Last Synced: 2024-12-20T02:44:49.684Z (22 days ago)
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Tools
- [XAMPP](https://www.apachefriends.org/index.html)
- [Visual Studio Code](https://code.visualstudio.com/)
- [MySQL Workbench](https://www.mysql.com/products/workbench/)## VS-Code Extensions
- [All In one PHP Support Extension Package](https://marketplace.visualstudio.com/items?itemName=DEVSENSE.phptools-vscode)
- [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense)## Description
This repository contains the source code for a simple PHP application that connects to a MySQL database. The application allows users to create, read, update, and delete users from a database. (CRUD)## SQL Statements
- Create User
```sql
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
```- Grant Privileges
```sql
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%';
```- Create Database
```sql
CREATE DATABASE 'database_name';
```- Create Table
```sql
CREATE TABLE 'table_name' (
'column_name' 'data_type' 'constraint',
'column_name' 'data_type' 'constraint',
'column_name' 'data_type' 'constraint',
...
);
```- Insert Data
```sql
INSERT INTO 'table_name' ('column_name', 'column_name', 'column_name', ...)
VALUES ('value', 'value', 'value', ...);
```- Select Data
```sql
SELECT 'column_name', 'column_name', 'column_name', ...
FROM 'table_name';
```- Update Data
```sql
UPDATE 'table_name'
SET 'column_name' = 'value', 'column_name' = 'value', 'column_name' = 'value', ...
WHERE 'condition';
```- Delete Data
```sql
DELETE FROM 'table_name'
WHERE 'condition';
```- Drop Table
```sql
DROP TABLE 'table_name';
```- Drop Database
```sql
DROP DATABASE 'database_name';
```- Inner Join
```sql
SELECT 'column_name', 'column_name', 'column_name', ...
FROM 'table_name'
INNER JOIN 'table_name' ON 'table_name'.'column_name' = 'table_name'.'column_name';
```