Jump to content
xisto Community
Sign in to follow this  
csmith

Import From Excel File Into Mysql Database

Recommended Posts

Has anyone tried using the excel import function that comes with phpmyadmin https://www.phpmyadmin.net/ - it does not require any additional plug-ins or scripts and is fairly straightforward to use. In phpmyadmin, if you click on the database table which you wish to import the data to , there is a link on the bottom left corner which says "insert data from a text file into the table" - although it says text file it still can be used to import an excel file. When you click on this link you will be taken to a page where you will be asked for the file name (the excel file should be saved as a csv file), how the fields in the file are terminated (you would change this to a "," without the quotation marks), and other data formatting attributes (these are usually left blank). I have never found any problem when using this

Share this post


Link to post
Share on other sites

Cool, I just wish you coulve posted this like a couple of months ago. A friend who is a programmer had to make a little php program that would import a huge excel file into phpmyadmin. He first exported the excel as text and then run it through his program and everything was loaded into phpmyadmin. This method wouldve saved us a lot of time.

Share this post


Link to post
Share on other sites

Hmmzzz I wil start working with that soon.I once started a website that was using excell as a database (only to view not to change) .. So all people in one company could look at the same data via intranet (php)...

Share this post


Link to post
Share on other sites

Import From Excel File Into Mysql Database using Java

Import From Excel File Into Mysql Database

 

I have to create a java desktop application that upload/loads the data from the MS Excel file (which is also on the desktop) into the specified table in a MySQL DB..

Share this post


Link to post
Share on other sites

how to import excel file to the database in php

Import From Excel File Into Mysql Database

 

Hi every body,,does any body can help me?in regards in importing an excel file to the data base in php language.Atually am building on it but theres nothing was there in my database

 

-reply by jai2

Share this post


Link to post
Share on other sites

how to upload csv file and make store data in batabase

Import From Excel File Into Mysql Database

 

Hai I want to Upload an CSV file and make store data in DB...

 

-question by Upendar

Share this post


Link to post
Share on other sites

How we can import an excel file into MYSQL database.

Import From Excel File Into Mysql Database

 

Please send me a correct PHP code to import an excel file into MYSQL databse.

 

Thanks.

 

-question by Jitendra Kumar

Share this post


Link to post
Share on other sites

Hi,I'm wrestling with the same issue for some time. We want to import our XLS files if possible to a MYSQL database and make them search-able. By the way I had another question that someone here may know the answer and that is how to invert this XLS file into TXT format to import it to MYSQL anyway?Thank you for your help.

Share this post


Link to post
Share on other sites

Import From Excel File Into Mysql Database

Import From Excel File Into Mysql Database

 

How to import excel data into MySQL database using PHP script? Do anyone know about it? could you help?

 

-reply by Jenny

Share this post


Link to post
Share on other sites

How we can import entries from database into excel sheet.Import From database Into excel sheetPlease send me a correct PHP code to import entries of database into excel sheet.Thanks in advance.-question by Sunil Kumar ---- admin reply ------Please use a tool called PHPmyADMIN to export into EXCEL directlyOREXPORT into CSV format.

Share this post


Link to post
Share on other sites
phpmyadmin Import From Excel File Into Mysql DatabaseCan it be accesses or launched via php code or API call? Is it open source? Please advise.-reply by Robert

Share this post


Link to post
Share on other sites
THANKS!Import From Excel File Into Mysql DatabaseIt's 4 years later, but just wanted to add my thanks. I'm struggling to learn all this stuff and spend hours searching the net for answers to my php / mysql / etc. Questions. Thought I'd need to download special software or write some fancy php code - NO! - your solution was a piece of cake!! More people should write-up their easy solutions and get them out for others to see. Thanks again.-reply by David

Share this post


Link to post
Share on other sites
import excel file to database in phpImport From Excel File Into Mysql Database

<?php  $data = array();    function add_person( $first, $middle, $last, $email )  {  global $data;    $data []= array(  'first' => $first,  'middle' => $middle,  'last' => $last,  'email' => $email   );  }    if ( $_FILES['file']['tmp_name'] )  {  $dom = DOMDocument::load( $_FILES['file']['tmp_name'] );  $rows = $dom->getElementsByTagName( 'Row' );  $first_row = true;  foreach ($rows as $row)  {  if ( !$first_row )  {  $first = "";  $middle = "";  $last = "";  $email = "";    $index = 1;  $cells = $row->getElementsByTagName( 'Cell' );  foreach( $cells as $cell )  {   $ind = $cell->getAttribute( 'Index' );  if ( $ind != null ) $index = $ind;    if ( $index == 1 ) $first = $cell->nodeValue;  if ( $index == 2 ) $middle = $cell->nodeValue;  if ( $index == 3 ) $last = $cell->nodeValue;  if ( $index == 4 ) $email = $cell->nodeValue;    $index += 1;  }  add_person( $first, $middle, $last, $email );  }  $first_row = false;  }  }  $username = "root";  $password = '';  $hostname = "localhost";  $con = mysql_connect($hostname,$username,$password)  or die("Unable to connect to MySQL");  mysql_select_db("sample",$con);  mysql_error();  foreach($data as $row)  {   mysql_query("insert into names values('','$row[first]','$row[middle]','$row[last]','$row')");  }  ?>

 

<html>   <head>     </head>   <body>   <form action='import.Php' method='post' name='names' enctype='multipart/form-data'>   <table>   <tr>   <td>Upload file :</td>   <td><input type='file' name='file'></td>   </tr>   <tr>   <td></td>   <td><input type='submit' value='upload'></td>   </tr>   </table>   </form>   </body></html>

 

-reply by kuppa pavan

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.