Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amankumarsinhagithub/image-upload-and-display-using-php-mysql
A simple PHP web application showcasing photo upload and display functionality. Users can input their details, upload photos, and view a table of user information, including uploaded photos.
https://github.com/amankumarsinhagithub/image-upload-and-display-using-php-mysql
backend backend-projects mysql mysql-database php php8
Last synced: 2 months ago
JSON representation
A simple PHP web application showcasing photo upload and display functionality. Users can input their details, upload photos, and view a table of user information, including uploaded photos.
- Host: GitHub
- URL: https://github.com/amankumarsinhagithub/image-upload-and-display-using-php-mysql
- Owner: AmanKumarSinhaGitHub
- Created: 2024-02-02T15:16:37.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-02T15:33:02.000Z (12 months ago)
- Last Synced: 2024-10-13T00:18:33.556Z (3 months ago)
- Topics: backend, backend-projects, mysql, mysql-database, php, php8
- Language: PHP
- Homepage:
- Size: 4.85 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Photo Upload and Display - PHP Assignment
This PHP project is a simple web application that allows users to input details, upload photos, and displays user information, including photos.
## Prerequisites
- PHP development environment (e.g., XAMPP, WampServer).
- MySQL database.
- Create a "uploads" folder in the project directory to store uploaded images.## Getting Started
1. Clone or download the project to your local machine.
2. Set up your MySQL database and update the connection details in `connect.php`.
3. Create a folder named "uploads" in the project directory.
4. Open the project in your PHP development environment.## Database Setup
1. **Create a MySQL database named "assignment":**
```sql
CREATE DATABASE assignment;
```2. **Create a "user" table within the database:**
```sql
CREATE TABLE user (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
description TEXT,
photo VARCHAR(255)
);
```## File Structure
- **connect.php:** Database connection details.
- **index.php:** User input form and photo upload.
- **handleInput.php:** Handles form submission, uploads photos, and inserts user details into the database.
- **displayUserDetails.php:** Displays user details, including photos, in a table.## Usage
### 1. Input User Details and Upload Photo
Open `index.php` in your browser, fill in the form with user details, select a photo, and click "Submit." The photo will be uploaded to the "uploads" folder, and user details will be stored in the database.
```php
Photo
Submit
```
### 2. Display User Details with Photos
Visit `displayUserDetails.php` in your browser to view a table displaying user details, including photos.
```php
while ($row = mysqli_fetch_assoc($result)) {
$id = $row["id"];
$name = $row["name"];
$description = $row["description"];
$photo = $row["photo"];echo
'
' . $id . '
' . $name . '
' . $description . '
';
}```
## More
[CRUD APP using PHP MySQl](https://github.com/AmanKumarSinhaGitHub/CRUD-App-using-PHP-MySQL)[Live Demo](https://php-mysql-crud-app.000webhostapp.com/)