sieg Posted December 13, 2006 Share Posted December 13, 2006 Hello,Here I have this website which is keeping contracts and invoices on a MySQL database.Now, I have a page where the contracts are listed and another one where invoices are listed.When I'm adding a new invoice I have a dropdown where client_name, contract_number and contract_date are concatenated so I can select the corresponding contract to add the invoice to.My issue is:on the contracts list page, I added a link to each contract, "View invoice" which is suppose to display the corresponding invoice.Can somebody help by telling me how should I format the hyperlink so the correct invoice opens?Right now I tried with "http://whatever.com/invoice_view.php?id=client" - where [b]client[/b] is the name of the field from invoice where those three values above are concatenated - but it returns a view table without any values on it.Thanks a lot!Cheers!Sieg Link to comment https://forums.phpfreaks.com/topic/30472-hyperlink-to-a-record-based-on-the-master-records-id/ Share on other sites More sharing options...
timmah1 Posted December 13, 2006 Share Posted December 13, 2006 When calling that page, ?id=client, the form is going to process and pull the information from the database from the variable 'id' matches the 'client'Do you have a snippet of your code?Here's a snippet of one of my codes:[code]$sql = "SELECT * FROM database WHERE client = '$id'";$result = mysql_query($sql);echo "<table border='1' width='100%'>";echo "<tr><th>Client</th><th>ID</th></tr>";while($row = mysql_fetch_array( $result )){echo "<tr><td valign=\"top\">"; echo "$row[client] "; echo "</td>"; echo "<td>"; echo "$row[id] </td>"; echo "</tr>";} echo "</table>";[/code] Link to comment https://forums.phpfreaks.com/topic/30472-hyperlink-to-a-record-based-on-the-master-records-id/#findComment-140364 Share on other sites More sharing options...
Cagecrawler Posted December 13, 2006 Share Posted December 13, 2006 I think you'll need to define $id as well:[code]$id = $_GET['id];[/code] Link to comment https://forums.phpfreaks.com/topic/30472-hyperlink-to-a-record-based-on-the-master-records-id/#findComment-140368 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.