Solarpitch Posted October 15, 2006 Share Posted October 15, 2006 Hey guys,I'm developing a golf store site and I need help with the following...I have a page that displays a list of driver names ie. Taylormade, Ping, Cobra etc...The page that displays these pulls the names from the database and displays them in a table. What I would like to have is when the table is being populated with the driver names, have a dynamic link created which each driver that will then display all the different models of that driver.Example:Taylormade view models>>Ping view models>>Cobra view models>> etc...Here's a quick example of the code that displays the driver names in the table...<th>Make</th></tr>";while($row = $result->fetch_assoc()) { echo "<tr>"; echo "<td>" . $row['make'] . "</td>"; echo "</tr>";Guys . . . I would love some help with this please, Thanks,Gerard. }echo "</table>"; Quote Link to comment Share on other sites More sharing options...
Orio Posted October 15, 2006 Share Posted October 15, 2006 Change the loop in the following way:[code]<?phpwhile($row = $result->fetch_assoc()){ echo "<tr>"; echo "<td>" . $row['make'] . "</td>"; echo "<td><a href=\"viewmodels.php?mod=". $row['make'] ."\">View Models</a></td>" echo "</tr>";}?>[/code]Then make a file called viewmodels.php that pulls out the models.Just be careful with SQL-Injections.Orio. Quote Link to comment Share on other sites More sharing options...
Solarpitch Posted October 15, 2006 Author Share Posted October 15, 2006 Thanks a million . . worked like a charm. I thought it was something along the lines of that alright, but I kept doing it in a JSP syntax :)Cool avatar by the way! 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.