adding a column

Codes here !

Moderators: macek, egami, gesf

beefsack
New php-forum User
New php-forum User
Posts: 5
Joined: Wed Dec 11, 2002 6:32 pm
Location: Australia

adding a column

Postby beefsack » Thu Feb 06, 2003 10:58 pm

ok, say i had a db which had a playerID field and a score field. say the playerID isnt a primary key and there is multiple instances of it. if i did "SELECT score FROM table WHERE playerID=4" it might return multiple results. how would i get a total of score instead of multiple results? i hope that made sense :P

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Fri Feb 07, 2003 2:53 am

SELECT sum(score) FROM table WHERE playerID=4

beefsack
New php-forum User
New php-forum User
Posts: 5
Joined: Wed Dec 11, 2002 6:32 pm
Location: Australia

Postby beefsack » Sun Feb 09, 2003 2:57 pm

thanks a ton :D thats perfect


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest