PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 18, 2022

[FIXED] Importing Excel sheet into phpMyAdmin

 February 18, 2022     csv, excel, mysql, phpmyadmin     No comments   

Issue

I'm currently playing around with phpMyAdmin and I have encountered a problem. When importing my CSV into phpMyAdmin it's rounding the numbers. I have set the column to be a float and the column in Excel to be a Number (Also tried text/General) to no avail. Has anyone else encountered this issue and found a viable work-around?

A second question, is it possible for me to upload the CSV file so that it matches the column names in phpMyAdmin to Excel column names and enters the data in the correct column?


Solution

  1. Your file should be look like this(decimal fields are of general type):

xlssheet

  1. Save as CSV. File will be probably saved with ; separated

This is for new table:

  1. Open phpMyAdmin, choose your database, click to import and select file to upload
  2. Change format to CSV if there is not selected
  3. Change in format specific options - columns separated with: ;
  4. Be sure that checkbox (The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)) is SELECTED
  5. Click Go
  6. New table will be created with the structure according to the forst line in CSV.

This is for existing table:

  1. Open phpMyAdmin, choose your database, CHOOSE YOUR TABLE which match the structure of imported file, click to import and select file to upload
  2. Change format to CSV if there is not selected
  3. Change in format specific options - columns separated with: ;
  4. Change skip number of queries to 1 (this will skip the first line with column names)
  5. Click Go
  6. Selected table wich has the same structure as CSV will be updated and rows in CSV inserted.


Answered By - Sauron
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing