haibec Posted February 23, 2007 Share Posted February 23, 2007 I want Insert multi values same same into a table .Please help me Link to comment Share on other sites More sharing options...
MrAdam Posted February 23, 2007 Share Posted February 23, 2007 i don't understand what you mean, fully?do you mean something like: INSERT INTO table (id,name,email) VALUES ('1','ADARMMMM!','adarrrrrrrrrrrrm@summit.com') (for example) ?? Link to comment Share on other sites More sharing options...
jesh Posted February 23, 2007 Share Posted February 23, 2007 Or perhaps: INSERT INTO table (name) VALUES ('ADARMMMM!'), ('jesh'), ('haibec'); Link to comment Share on other sites More sharing options...
haibec Posted February 24, 2007 Author Share Posted February 24, 2007 Or perhaps:INSERT INTO table (name) VALUES ('ADARMMMM!'), ('jesh'), ('haibec'); Example: I have a table Class include fileds : Name,Class . I want insert 1000 row same Link to comment Share on other sites More sharing options...
MrAdam Posted February 24, 2007 Share Posted February 24, 2007 <?phpfor (i=0;i<1000;i++) {$query = mysql_query("INSERT INTO Class (Name,Class) VALUES ('Something','Something')");}?> use that php code ... Link to comment Share on other sites More sharing options...
PrateekSaxena Posted February 24, 2007 Share Posted February 24, 2007 I think what you can do is that first make an array of the things that you want to put into the table and then instead of writing "Something" you can write thatArray . Link to comment Share on other sites More sharing options...
Yahweh Posted February 28, 2007 Share Posted February 28, 2007 I want Insert multi values same same into a table .Please help meInserting a record with multiple values is easy:INSERT INTO table (field1, field2, field3)VALUES (val1a, val1b, val1c)WHERE condition = @condition; If you want to insert multiple records, its practically the same thing, except you seperate the values for each record by a comma: INSERT INTO table (field1, field2, field3)VALUES (val1a, val1b, val1c), (val2a, val2b, val2c), (val3a, val3b, val3c), (val4a, val4b, val4c)WHERE condition = @condition; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now