473,503 Members | 1,700 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 2140
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
4429
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
2209
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: ...
12
2355
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...
1
4569
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...
1
3019
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...
11
3375
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...
1
3648
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...
7
1950
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
6184
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...
0
7202
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,...
0
7084
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...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5578
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,...
1
5013
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...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.