Import CSV File Data in Mysql Using PHP Code

| Last Updated: | In: Core php


This is the easy method to upload/import your csv file data in mysql table, using the simple php code. We are using the ( PHP-PDO ) for the communicates with mysql database.

Below is the easy and simple steps for using this code. Create a mysql table using the below code :

Create database table

Select your database and create a table seoreports with id, account_name, ranking, alerts, opportunities, pdf_report fields. Open SQL tabs in phpMyadmin and Copy paste below query to create table.

Html Code

Create index.php page and ad below code.

PHP Code using PDO

In the below code i have used PDO (PHP Data Object) to connect with database and import csv data in database table.

download

Tags: , , , ,


About: Prem Tiwari

Prem Tiwari is founder of freewebmentor.com and Software developer from New Delhi (India). Follow Prem's development codes on facebook, and make sure you check out freewebmentor.com for the latest in web development related Tips with the complete code.


You may also like:

Follow us!

Get Free Access of 350+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...

SEARCH NOW