pumaf1 Posted August 31, 2007 Share Posted August 31, 2007 Hia All (again), I can get a list of what i want like this: http://www.pumaf1.org.uk/res/infobase/driverall.php (but it need tweaking - under another topic) now i have got it to go to the results page (took me ages) the code: <?php // connect to the server mysql_connect( 'localhost', '', '' ) 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() ); // get the id from the URL request $name = $_REQUEST['name']; // retrieve the row from the database $query = "SELECT * FROM `infobase` WHERE `name`='$name'"; $result = mysql_query( $query ); // print out the results if( $result && $contact = mysql_fetch_object( $result ) ) { // print out the info $name = $contact -> name; ?> no what i want it to do is query the db and bring out all of the records for that driver as defined in $name, for the wholeof that drivers career but limited to a certain number of records. again anyone that can help please do! thanks Link to comment https://forums.phpfreaks.com/topic/67471-repeat-region/ Share on other sites More sharing options...
fenway Posted August 31, 2007 Share Posted August 31, 2007 A Limit clause/ Link to comment https://forums.phpfreaks.com/topic/67471-repeat-region/#findComment-338847 Share on other sites More sharing options...
pumaf1 Posted August 31, 2007 Author Share Posted August 31, 2007 sorry this is what I mean 1 - you select a driver - for example Berger, Gerhard from this page - http://www.pumaf1.org.uk/res/infobase/driverall.php 2 - the system then takes you to a page - (which it does) 3 - what it should do is - select ALL the races the driver has driven. (I want to expand on this to limit it to say 50 records per page) hope that helps show you want i want it to do. Link to comment https://forums.phpfreaks.com/topic/67471-repeat-region/#findComment-338851 Share on other sites More sharing options...
fenway Posted September 4, 2007 Share Posted September 4, 2007 You should be in a while loop: while( my $record = mysql_fetch_assoc( $result ) ) As for pagination, there are many tutorials on this subject... Link to comment https://forums.phpfreaks.com/topic/67471-repeat-region/#findComment-341527 Share on other sites More sharing options...
pumaf1 Posted September 4, 2007 Author Share Posted September 4, 2007 fenway thankyou for your response however i an a total rookie at this, i have allowed dreamweaver to do this in the past and i would love some links to somewhre i could learn from thankyou again dave Link to comment https://forums.phpfreaks.com/topic/67471-repeat-region/#findComment-341614 Share on other sites More sharing options...
fenway Posted September 6, 2007 Share Posted September 6, 2007 I don't know of any tutorials per se... maybe someone else could recommend somthing? Link to comment https://forums.phpfreaks.com/topic/67471-repeat-region/#findComment-343321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.