russellr
Elite Level 1
[M:5000]
rCs?
Posts: 525
|
Post by russellr on Dec 10, 2010 18:50:29 GMT
Ok ran into what I think should be a simple fix but i'm getting lost here. I've got a simple database with a few fields the field in question is player_name mysql_query("SELECT * FROM cricket") I need to show only one link to each player but is there anyway to limit to show only one record where the player_name value has already been pulled to stop multiple links of the same name being shown? Make any sense? cricket.rjb.im/index.phpThats the page i need it to only show one link to each player.
|
|
Bobby
Junior Poster
Welly welly welly well
Posts: 14
|
Post by Bobby on Dec 10, 2010 19:05:59 GMT
Ok ran into what I think should be a simple fix but i'm getting lost here. I've got a simple database with a few fields the field in question is player_name mysql_query("SELECT * FROM cricket") I need to show only one link to each player but is there anyway to limit to show only one record where the player_name value has already been pulled to stop multiple links of the same name being shown? Make any sense? cricket.rjb.im/index.phpThats the page i need it to only show one link to each player. You could use the DISTINCT keyword to return only one copy of the identifier you're after. SELECT DISTINCT player_name FROM cricket If you need the entire row and don't want duplicate player entries then you need to rethink your schema. At that point your forms aren't normalized even to first normal form, when it's more appropriate that they be written to third normal form at the very least.
|
|
russellr
Elite Level 1
[M:5000]
rCs?
Posts: 525
|
Post by russellr on Dec 10, 2010 22:06:15 GMT
Thanks that works perfectly just the type of keyword I was hoping for
|
|