NextGenForum.net Posted October 28, 2007 Share Posted October 28, 2007 SelectGreen.co.uk has 11 different categories, in each there is a selection of companies, i want to link the 'Company Name' to another page called viewproperty.php. This is the page that will dispplay all companies using php db tags. I cant remember the link its something like viewproperty.php=ID? i have done it b4 but just cant remember Quote Link to comment Share on other sites More sharing options...
NextGenForum.net Posted October 28, 2007 Author Share Posted October 28, 2007 Ive just remembered and its /viewproperty.php?id= now i need to know how to get the individual comppany details onto this one page so its different every time. last time i did it it was something to do woth dynamic Quote Link to comment Share on other sites More sharing options...
NextGenForum.net Posted October 28, 2007 Author Share Posted October 28, 2007 http://www.selectgreen.co.uk/viewproperty.php?ID= the ID isnt coming up either Quote Link to comment Share on other sites More sharing options...
AndyB Posted October 28, 2007 Share Posted October 28, 2007 Clearly there's a problem with your code. Time to post some instead of asking for random guesses. Is it really ID or id? Retrieve a passed parameter in the URL using $this = $_GET['this'] or equivalent Quote Link to comment Share on other sites More sharing options...
NextGenForum.net Posted October 28, 2007 Author Share Posted October 28, 2007 <a href="/viewproperty.php?id="><?php echo $row_property['name']; ?></a> ive got that what u meen by this $this = $_GET['this'] Quote Link to comment Share on other sites More sharing options...
AndyB Posted October 28, 2007 Share Posted October 28, 2007 <a href="/viewproperty.php?id="><?php echo $row_property['name']; ?></a> Well, that's never going to work. The value of the id (a presumed database reference) needs to be added to it. How that happens is a result of your code. We don't need to see it all, but we obviously need to see some of the php code that generates that line - say 10-20 lines of code. what u meen by this $this = $_GET['this'] That's an example of retrieving the value of a parameter passed by URL link. Quote Link to comment Share on other sites More sharing options...
NextGenForum.net Posted October 28, 2007 Author Share Posted October 28, 2007 <?php require_once('Connections/sgreen.php'); ?> <?php $maxRows_property = 10; $pageNum_property = 0; if (isset($_GET['pageNum_property'])) { $pageNum_property = $_GET['pageNum_property']; } $startRow_property = $pageNum_property * $maxRows_property; mysql_select_db($database_sgreen, $sgreen); $query_property = "SELECT * FROM property ORDER BY id DESC"; $query_limit_property = sprintf("%s LIMIT %d, %d", $query_property, $startRow_property, $maxRows_property); $property = mysql_query($query_limit_property, $sgreen) or die(mysql_error()); $row_property = mysql_fetch_assoc($property); if (isset($_GET['totalRows_property'])) { $totalRows_property = $_GET['totalRows_property']; } else { $all_property = mysql_query($query_property); $totalRows_property = mysql_num_rows($all_property); } $totalPages_property = ceil($totalRows_property/$maxRows_property)-1; ?> thats the noly bit i can think u woudl need all the rest is tables images etc, nohing to do with dbs Quote Link to comment Share on other sites More sharing options...
AndyB Posted October 29, 2007 Share Posted October 29, 2007 Your question was why a URL generated didn't include the actual value of an id (or ID). The code you posted isn't what generates that URL. The code you posted assumes that other variables are passed somehow to a page that presumably displays stuff from the database regardless of id. So, what's the real question? 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.