473,656 Members | 2,777 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

importing file in php myadmin

54 New Member
presently i have a table in which there are records and the fields are slno (this is a primary key auto increment), firstname, lastname, email, date(which inserts as a date format) these records are presenty being inserting from a html form. this works fine.

i have additional data that is on paper and this paper data needs to be added to this table and the are numerous records that have to be inserted so executing an sql query from myphpadmin is not a good option. due to this i would lke to add the paper data first into a text file or csv file and then use the Import feature in phpyadmin so that this new data is added to the existing table along with the data that is already inserted through the form.

please advice
1. if a text file or csv file is preferrable.
2. in what format should the data be entered in the case of
a) text file & ) csv file

should i mention slno, firstname, lastname, email, date
on top of the file and add data accordingly.

also as slno is auto increment do i need to specify the numeric number or is it optional and in case of date do i need to follow the same format as it is for previous records while entering the data manually into the text or csv file.

thanks.
Jan 22 '08 #1
2 2150
rpnew
188 New Member
presently i have a table in which there are records and the fields are slno (this is a primary key auto increment), firstname, lastname, email, date(which inserts as a date format) these records are presenty being inserting from a html form. this works fine.

i have additional data that is on paper and this paper data needs to be added to this table and the are numerous records that have to be inserted so executing an sql query from myphpadmin is not a good option. due to this i would lke to add the paper data first into a text file or csv file and then use the Import feature in phpyadmin so that this new data is added to the existing table along with the data that is already inserted through the form.

please advice
1. if a text file or csv file is preferrable.
2. in what format should the data be entered in the case of
a) text file & ) csv file

should i mention slno, firstname, lastname, email, date
on top of the file and add data accordingly.

also as slno is auto increment do i need to specify the numeric number or is it optional and in case of date do i need to follow the same format as it is for previous records while entering the data manually into the text or csv file.

thanks.
Hi,
You can use the LOAD DATA... query in MySql to load data from file to MySql table. Check the link..

Regards,
RP
Jan 22 '08 #2
code green
1,726 Recognized Expert Top Contributor
please advice
1. if a text file or csv file is preferrable.
A CSV file is a text file with comma-seperated data.
But use CSV, just be sure to type a comma in the "Fields seperated by" box.
The other fields can be left as default
2. in what format should the data be entered in the case of
a) text file & ) csv file
Each data field seperated by a comma, with carriage return at end of record.
Do not leave the field headings in the file.
You can seperate with semi-colons or tabs, recommended if you have commas in your data, but be sure to specify so in 1. above
should i mention slno, firstname, lastname, email, date on top of the file and add data accordingly
If you leave them as headings in the file the headings will be entered as a record.
Not fatal but a nuisance.
Enter the field names in the "Column names" box, seperated by a comma in the order they are in the file.
If the number of fields matches the number of field entries in the file then you can leave box empty.
also as slno is auto increment do i need to specify the numeric number or is it optional
The table will generate the numbers, but if you specify them in the data, this will take precedence
and in case of date do i need to follow the same format as it is for previous records while entering the data manually into the text or csv file.
MySql expects the format YYYY-MM-DD in a DATE field.
I don't recommend any other format
Try some test runs first on a test table to get the feel.
It is reliable but big files may timeout
Jan 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4440
by: Simon | last post by:
How can I access my php.ini file with webhosting at yahoo. it does not show in my file manager or MyAdmin directory.
11
2224
by: Jeff Wagner | last post by:
I am importing a file which contains a persons name (firstName, middleName, etc). If I define a function to do this, how can I use the variables outside of that function? Here is the code: import string def getName(): data = open("enterName.txt")
12
2381
by: qwweeeit | last post by:
The pythonic way of programming requires, as far as I know, to spread a big application in plenty of more manageable scripts, using import or from ... import to connect the various modules. In some cases there is a further complication: module importing through an indirect mechanism, like: exec "from " + xxx + " import *". A part the fact that I have not understood the "real" difference between import and from ... import (or also from......
1
4583
by: Thomas R. Hummel | last post by:
Hello, I am importing a file using BCP, with a format file. It is a fixed-width file, which I am importing into a table that has a column for each field in the file. The columns in my import table are all defined as CHAR. I use it as a staging area to check the data (are dates formatted correctly, etc.) before moving it from there. In one of my files I have six records that contain strange characters (ascii codes of 03 and 02 if I am...
1
3033
by: Nico Grubert | last post by:
Hi there, I would like to copy a file from one machine (machine #01) to another (machine #02). machine #01: Suse Linux 9.2, Samba 3, Python 2.3.5 machine #02: Windows Machine, Destination Dir: <Share>\temp\files\ Both machines are in one network so they can communicate each other. In order to be able to write a file in the directory on Machine #02 I need
11
3395
by: Grim Reaper | last post by:
I am importing a .csv file into Access that has 37 fields. My problem is that sometimes the last field only has data at the end of the column (it looks like when you import a file into Access, for the last field, it only checks the top few 'cells' to see if there is any data, if not, the field is not imported). How do I 'force' Access to import the field, regardless if there is data in the top of the field or not? For instance, I might...
1
3670
by: sparks | last post by:
I have never done this and wanted to ask people who have what is the best way. One person said import it to excel, then import it into access table. but since this will be done a lot, I am trying to avoid this extra step. can access read in this file directly into a table as append data? thank you very much for any pointers
7
1958
by: hg | last post by:
Hi, I have the following problem. I find in a directory hierarchy some files following a certain sets of rules: ..../.../../plugin/name1/name1.py ..... ..../.../../plugin/namen/namen.py
12
6208
by: JMO | last post by:
I can import a csv file with no problem. I can also add columns to the datagrid upon import. I want to be able to start importing at the 3rd row. This will pick up the headers necessary for the datagrid. Once I can get to that point I need some way to be able to add new data only to the new columns that were added. Here is some of my code: //Function For Importing Data From CSV File public DataSet ConnectCSV(string filetable)
0
8382
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7311
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.