Scores system

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

Post Reply
ek5932
Forum Commoner
Posts: 25
Joined: Mon Jun 28, 2004 5:55 pm

Scores system

Post by ek5932 »

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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

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 »

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 »

I know how to insert information, im just not sure how to insert 100 lines ordered by size into the db
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

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 »

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 »

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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

using a sort of the data first, or just select with an order by, which is the more conventional way...
Post Reply