Tombie Posted April 30, 2010 Share Posted April 30, 2010 Hey, basically i am trying to use dynamic drop down boxes so that once the first box has selected a value then it retreives information from the database and then populates the second box. The script actualyl works perfectly, problem is it works too perfectly and the database i have perhaps is made in the wrong way. So its a replica football ground, there are 4 tables, one for each stand. each table contains id, block number, row and seat number However obviously there are more than 1 row per block, more than 1 seat per row, leaving me with multiple duplicate entries appearing in the drop down box, not what i want, it turns out like Row: A A A A A A A A A A A A A A A A A A A A B B B B B B B B B B B, when clearly i just want the 1 instance of A and B and everything. Now im wondering, is this because of php? the mysql database? not sure where to post it but figured here would be good and if its not, it can be moved/posted elsewhere since its a mixture of problems. So my question is what can i do to make it so that there is only 1 instance of each of these occuring, any help would be appreciated as on a short time scale to complete this now thanks in advance, any more info required can be provided Link to comment https://forums.phpfreaks.com/topic/200308-php-help-multiple-drop-downs-retreiving-information-from-database/ Share on other sites More sharing options...
ChaosKnight Posted April 30, 2010 Share Posted April 30, 2010 Put UNIQUE in the SQL statement Link to comment https://forums.phpfreaks.com/topic/200308-php-help-multiple-drop-downs-retreiving-information-from-database/#findComment-1051202 Share on other sites More sharing options...
Tombie Posted April 30, 2010 Author Share Posted April 30, 2010 Put UNIQUE in the SQL statement yes gave me the right answer, i put DISTINCT in it and working thanks Link to comment https://forums.phpfreaks.com/topic/200308-php-help-multiple-drop-downs-retreiving-information-from-database/#findComment-1051207 Share on other sites More sharing options...
ChaosKnight Posted April 30, 2010 Share Posted April 30, 2010 Sorry, I meant to say DISTINCT, don't know why I said UNIQUE... lol ... But if it's working now, then it's super Link to comment https://forums.phpfreaks.com/topic/200308-php-help-multiple-drop-downs-retreiving-information-from-database/#findComment-1051212 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.