Discuss Anything: Replying To Import From Excel File Into Mysql Database - Discuss Anything

Jump to content


Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Replying to Import From Excel File Into Mysql Database

Enter a name

  • Security Code
    Your unique security code
    If you do not see any numbers, or see broken images, please contact a board administrator to rectify the problem.
    Confirm security code
    Please enter the 6 character code shown in the image. If you cannot read the code, click the image to generate a new one. Case sensitive.

    Can't make it out? Click here to generate a new image

Post

This post will need approval from a moderator before this post is shown.

Options

Post Options


Post icon

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •   [ Use None ]

  or Cancel


Topic Summary

iGuest 

Posted 02 December 2009 - 03:16 PM

I gett he following error with this script...Import From Excel File Into Mysql Database

Fatal error: Call to a member function getelementsbytagname() on a non-object

I get the above error with this script.  I have not changed anything in the script and my excel file has four columns with no headers in the first row.  Can anyone help?!?

-reply by Nicholas

 

iGuest 

Posted 17 November 2009 - 09:29 AM

import excel file to database in phpImport From Excel File Into Mysql Database

$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[email]')");  }  ?>

 

         

                   
Upload file :
 
 

-reply by kuppa pavan

 

iGuest 

Posted 04 August 2009 - 10:03 PM

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

iGuest 

Posted 07 December 2008 - 12:36 AM

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

iGuest 

Posted 10 September 2008 - 10:41 AM

How we can import entries from database into excel sheet.
Import From database Into excel sheet

Please 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 directly

OR

EXPORT into CSV format.

iGuest 

Posted 09 September 2008 - 04:23 AM

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

CyrusX 

Posted 04 September 2008 - 03:35 AM

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.

iGuest 

Posted 25 August 2008 - 08:53 AM

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

iGuest 

Posted 01 July 2008 - 06:04 AM

Where's the "insert data from a text file into the table" ?
I can't even find it..

-reply by Piper

iGuest 

Posted 09 June 2008 - 09:37 AM

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

Review the complete topic (launches new window)


Google Fan :-) We Recommend Firefox.     Customize / Settings Connect Us on facebook