473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to store table of data in to mysql?

How to store table of data into mysql at single query ? please reply me
Dec 17 '10 #1
1 1743
AutumnsDecay
170 100+
If you have a form, for example, that has:

First Name:
Last Name:
Email Address:

and you wanted to put those values into a table called 'users', you'd do:

Expand|Select|Wrap|Line Numbers
  1. $fname = $_POST['firstname'];
  2. $lname = $_POST['lastname'];
  3. $email = $_POST['emailaddress'];
  4.  
  5. $query = "INSERT INTO `users` (Firstname, Lastname, Email) VALUES ('$fname', '$lname', '$email')";
  6.  
  7. mysql_query($query);
  8.  
The table 'users' would need a field thats used as the primary key that auto increments with each new submission to the table.
Dec 21 '10 #2

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

Similar topics

0
by: David Bordas | last post by:
Hi list, I've got a little bug with MySQL. I can insert a row into my table but this row will not appear in the table :( Server is under linux redhat, MySQL is 3.23.56 installed from binary...
3
by: guy | last post by:
Hi, How do I store pictures in mySQL? What is the data type for this field? TIA
2
by: ssb | last post by:
Hello, Am interested in knowing, how MS-access stores data internally... When I create a table and load records into it, I dont find any "data file" being created that possibles stores my...
1
by: Matik | last post by:
Hey, First, sorry if this post appear twice, because, I can not find my post recently send, trying to post it once again. I'm out of ideas, so, I thought, will search help here again :( I'm...
7
by: mukeshpatil | last post by:
How to get data from .CSV file using php & store it into Mysql database I want to read data from two different .CSV files using php & How to store it into Mysql Database tables Please help me...
3
by: ravikiranveluguleti | last post by:
hi, this is ravikiran i am working on a project(using java & mysql) that requires creation of a editable mysql file that contains all the data present in a particular table ,(like .mdb file that...
5
by: keeps21 | last post by:
Ok, so here goes. I need to retrieve data, (ie. id, title, introtext.) from my database and store each in a variable. I then need to repeat this for the next 4 records. So I would have 5...
7
by: sathyashrayan | last post by:
Dear group, A mysql wrapper class, which just uses the CRUD operations for large scale php development. Is the same advisable for the mysql stored procedure? Following is a link I got from...
5
by: amit | last post by:
assume we have 10,000 cities. imagine those distance calculating tables, where city A (row) to city Z (col) would equal a float value. city Z (row) to city Z(col) would be 0. The only problem is...
2
by: kkshansid | last post by:
cannot import table in mysql 1i saved my excell file in csv formate 2i made a data base in mysql 3i made a table with 5 fields 4i run this file error Parse error: syntax error, unexpected...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.