gilanib Posted February 25, 2012 Share Posted February 25, 2012 Greetings! I have a website www.lanceronlinejobs.com/our_franchises.php I have a franchise images. I want to display each franchise record from database whenever a user click on franchise link. Here is my code. ourfranchises.php code: <?php include('fconnection.php'); $sql = mysql_query("SELECT * FROM tbl_franchise ORDER BY id DESC") or die(mysql_error()); $row3 = mysql_fetch_array($sql); ?> <a href="franchiseDetails.php?city=<?php echo $row3['city'];?>"><img src="images/lbatkhela.jpg" width="150" height="150" alt="Batkhela" /></a> ---------------------------------------------------------------------- franchiseDetails.php code: <?php $id = $_GET['id']; $query = "SELECT * FROM tbl_franchise WHERE id = '$id' ORDER BY id DESC LIMIT 1"; $result = mysql_query($query); if (!$result) { echo "NO RECORD FOUND"; } else { while($row3 = mysql_fetch_array($result)): ?> Manager Name: <?php echo $row3['manager_name'];?> Please help me. Any help would be appreciated. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/257752-display-record-with-image-link/ Share on other sites More sharing options...
litebearer Posted February 25, 2012 Share Posted February 25, 2012 quick look see.. top script variable is city, second script variable is id. they need to be the same. Quote Link to comment https://forums.phpfreaks.com/topic/257752-display-record-with-image-link/#findComment-1321073 Share on other sites More sharing options...
jamesxg1 Posted February 25, 2012 Share Posted February 25, 2012 Greetings! I have a website www.lanceronlinejobs.com/our_franchises.php I have a franchise images. I want to display each franchise record from database whenever a user click on franchise link. Here is my code. ourfranchises.php code: <?php include('fconnection.php'); $sql = mysql_query("SELECT * FROM tbl_franchise ORDER BY id DESC") or die(mysql_error()); $row3 = mysql_fetch_array($sql); ?> <a href="franchiseDetails.php?city=<?php echo $row3['city'];?>"><img src="images/lbatkhela.jpg" width="150" height="150" alt="Batkhela" /></a> ---------------------------------------------------------------------- franchiseDetails.php code: <?php $id = $_GET['id']; $query = "SELECT * FROM tbl_franchise WHERE id = '$id' ORDER BY id DESC LIMIT 1"; $result = mysql_query($query); if (!$result) { echo "NO RECORD FOUND"; } else { while($row3 = mysql_fetch_array($result)): ?> Manager Name: <?php echo $row3['manager_name'];?> Please help me. Any help would be appreciated. Thanks. Hi! Would you please describe in a bit more detail what your issue here is? It's probably just me not understanding here LOL. Also, I think it would be a good idea to use mysql_num_rows at some point. James. Quote Link to comment https://forums.phpfreaks.com/topic/257752-display-record-with-image-link/#findComment-1321075 Share on other sites More sharing options...
gilanib Posted February 25, 2012 Author Share Posted February 25, 2012 Yes you are right. variables must be same. Dear actually I have a franchise page where my company's franchises shown as a image. So what I want is that when a user click on an image like "Batkhela", The next page will display the Batchela's franchiser details [manager name] [city] . Please help. Quote Link to comment https://forums.phpfreaks.com/topic/257752-display-record-with-image-link/#findComment-1321088 Share on other sites More sharing options...
gilanib Posted February 27, 2012 Author Share Posted February 27, 2012 Please help me out in that case. Quote Link to comment https://forums.phpfreaks.com/topic/257752-display-record-with-image-link/#findComment-1321609 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.