pumaf1 Posted August 31, 2007 Share Posted August 31, 2007 Hi All, I am trying to make an "application" on my website. What I am trying to write is a results database that pulls data from F1 races to a web page. the system will therefore have more than one instance of each team. what I want it to do, is look at the db and select one instance, and one instance only, not list the whole lot. You can see what It is doing here http://www.pumaf1.org.uk/res/infobase/teamall.php the code i have so to select the data from the db is: // connect to the server mysql_connect( '', '', '' ) or die( "Error! Could not connect to database: " . mysql_error() ); // select the database mysql_select_db( '') or die( "Error! Could not select the database: " . mysql_error() ); // retrieve all the rows from the database $query = "SELECT * FROM `infobase` ORDER BY team asc"; $results = mysql_query( $query ); // print out the results if( $results ) { ?> $query = "SELECT * FROM 'infobase' ORDER BY team asc"; if anyone could help me it would be greatly taken Quote Link to comment Share on other sites More sharing options...
fenway Posted August 31, 2007 Share Posted August 31, 2007 How did you solve this? Quote Link to comment Share on other sites More sharing options...
pumaf1 Posted August 31, 2007 Author Share Posted August 31, 2007 sorry should have put the resolution, my apologies From // retrieve all the rows from the database $query = "SELECT * FROM `infobase` ORDER BY team asc"; to // retrieve all the rows from the database $query = "SELECT * FROM infobase"; $query = "SELECT DISTINCT team FROM infobase ORDER BY team asc"; dave Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.