PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ek5932
Forum Commoner
Posts: 25 Joined: Mon Jun 28, 2004 5:55 pm
Post
by ek5932 » Tue Sep 14, 2004 1:34 pm
I need create a scores syetm that insterts the top 100 kingdoms into my database but am not sure how to do it. All i need help with is is how to insert the data, if some one could just tell me what i need to look up that would be great. thanks.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Sep 14, 2004 2:08 pm
mysql: [mysql_man]insert[/mysql_man]
postgre: [pg_man]insert[/pg_man]
Draco_03
Forum Regular
Posts: 577 Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada
Post
by Draco_03 » Tue Sep 14, 2004 2:11 pm
feyd wrote: mysql: [mysql_man]insert[/mysql_man]
postgre: [pg_man]insert[/pg_man]
I know that for a noob (me) reading doc from mysql.com can be a little bit confusing
So just in case try
here
EDIT : I took granted that you are able to write php, make a connection to a database and extract some data.
ek5932
Forum Commoner
Posts: 25 Joined: Mon Jun 28, 2004 5:55 pm
Post
by ek5932 » Tue Sep 14, 2004 2:40 pm
I know how to insert information, im just not sure how to insert 100 lines ordered by size into the db
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Sep 14, 2004 2:41 pm
100 inserts, generally... unless your database supports multi-inserts...
ek5932
Forum Commoner
Posts: 25 Joined: Mon Jun 28, 2004 5:55 pm
Post
by ek5932 » Tue Sep 14, 2004 2:45 pm
so the best thing would be to loop the insert 100 times? how would I order the size of the inserts tho, as individualy they have no order.
Draco_03
Forum Regular
Posts: 577 Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada
Post
by Draco_03 » Tue Sep 14, 2004 2:46 pm
you can make a loop, where it insert all your data
but it'll be inserted 100 times..
don't know if you get what i'm saying
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Sep 14, 2004 2:47 pm
using a sort of the data first, or just select with an order by, which is the more conventional way...