Ameslee Posted December 19, 2006 Author Share Posted December 19, 2006 ok another problem has arised. Ok the records are now links, but now when i click on the link it goes to the page but it says not record found. I was working on this page yesterday with Thorpe, and it was working fine. here is the code that runs the 2 pages.code1[code]<?php for ($i = 'A'; $i != 'AA'; $i++){ echo "<a href = \"?search=$i\"> $i </a>"; } if(isset($_GET['search']) && $_GET['search'] != ''){ $hostname = localhost; $username = ; $password = ; $conn = mysql_connect($hostname, $username, $password) or die(mysql_error()); $connection = mysql_select_db("greenac_VORNExpo", $conn); $search = $_GET['search']; $sql = mysql_query("SELECT * FROM exhibits WHERE exhibit LIKE '$search"."%'") or die(mysql_error()); while ($row = mysql_fetch_array($sql)){ // display results echo "<br /><a href=\"display_exhibits1.php\">" .$row['exhibit']. "</a><br />"; } } ?>[/code]Now for the second page[code]<?php $hostname = localhost; $username = ; $password = ; $conn = mysql_connect($hostname, $username, $password) or die(mysql_error()); $connection = mysql_select_db("greenac_VORNExpo", $conn); $query = "SELECT * FROM `exhibits` WHERE serviceid='{$_GET['id']}'"; if ($mysql_result = mysql_query($query,$conn)) { if (mysql_num_rows($mysql_result) > 0) { $row=mysql_fetch_row($mysql_result); echo("<table width=100%><tr><td width=20%><b>Exhibit:</b><td width=35%>$row[1]"); echo("<tr><td width=20%><b>Located:</b><td width=35%>$row[2]"); echo("<tr><td width=20%><b>Services:</b><td width=35%>$row[3]"); echo("<tr><td width=20%><b>More Info:</b><td width=35%>"); echo("<tr><td width=10%><b>Contact Person:</b><td width=35%>$row[5]"); echo("<tr><td width=10%><b>Contact Number:</b><td width=35%>$row[6]"); echo("<tr><td width=10%><b>Mobile:</b><td width=35%>$row[7]"); echo("<tr><td width=10%><b>Email:</b><td width=35%>$row[8]"); } else { echo "No results found"; } } else { echo "Query failed: ". mysql_error() . ": $query"; } ?>[/code] Link to comment https://forums.phpfreaks.com/topic/31185-help-with-code-a-z-listing/page/2/#findComment-144273 Share on other sites More sharing options...
Ferenc Posted December 19, 2006 Share Posted December 19, 2006 You would need to pass id to the second page[code]<a href=\"display_exhibits1.php?id=".$row['serviceid']."............[/code] Link to comment https://forums.phpfreaks.com/topic/31185-help-with-code-a-z-listing/page/2/#findComment-144275 Share on other sites More sharing options...
Ameslee Posted December 19, 2006 Author Share Posted December 19, 2006 ill just try that, thanks Link to comment https://forums.phpfreaks.com/topic/31185-help-with-code-a-z-listing/page/2/#findComment-144277 Share on other sites More sharing options...
Ferenc Posted December 19, 2006 Share Posted December 19, 2006 [code]echo "<br /><a href=\"display_exhibits1.php?id=".$row['serviceid']."\">" .$row['exhibit']. "</a><br />";[/code]you needed to fill in the rest, hence the ........ Link to comment https://forums.phpfreaks.com/topic/31185-help-with-code-a-z-listing/page/2/#findComment-144278 Share on other sites More sharing options...
Ameslee Posted December 19, 2006 Author Share Posted December 19, 2006 thanks, its working fine Link to comment https://forums.phpfreaks.com/topic/31185-help-with-code-a-z-listing/page/2/#findComment-144283 Share on other sites More sharing options...
trq Posted December 19, 2006 Share Posted December 19, 2006 I said it in another thread. Your html is poorly formatted. You have no closing </td> tags. Link to comment https://forums.phpfreaks.com/topic/31185-help-with-code-a-z-listing/page/2/#findComment-144284 Share on other sites More sharing options...
Ameslee Posted December 19, 2006 Author Share Posted December 19, 2006 it works fine, SOLVED, thanks all Link to comment https://forums.phpfreaks.com/topic/31185-help-with-code-a-z-listing/page/2/#findComment-144288 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.