jobs1109 Posted August 18, 2011 Share Posted August 18, 2011 Ok hre is what I got so far This first page does a query on mysql table and passed id for row by link here is the code <?php session_start(); include'../../DB-Connect101/DB-Connect101.php'; $_SESSION['Keyword_Search'] = $_POST['Keyword_Search']; $_SESSION['Jobcategory'] = $_POST['Jobcategory']; $Keyword_Search = $_SESSION['Keyword_Search']; $Jobcategory = $_SESSION['Jobcategory']; // echo $Keyword_Search; to be used in future // echo $Jobcategory; to be used in future $id=$_GET['id']; $jobs_sql = "SELECT id,JobTitle FROM Jobs ORDER BY id ASC"; $jobs_query= mysql_query($jobs_sql) or die (mysql_error); $rsjobs=mysql_fetch_assoc($jobs_query); ?> <body> <?php do {?> <p><a href="http://www.hiringinhilo.com/Hilo-Jobs/Job-Search-Form/Getting-Data-From-Database/Job-Details/Job-Details.php">id=<?php echo $rsjobs['id'];?><?php echo $rsjobs['JobTitle']; ?></a> <?php } while ($rsjobs=mysql_fetch_assoc($jobs_query)) ?> </body> here is the second page where the row should print out corresponding to the id click on the first page but nothing gets dispayed. What is wrong with my code ? please help ? second page <?php session_start(); ?> <?php include'../../../DB-Connect101/DB-Connect101.php'; $Keyword_Search = $_SESSION['Keyword_Search']; $Jobcategory = $_SESSION['Jobcategory']; // echo $Keyword_Search; // echo $Jobcategory; $id=$_GET['id']; $jobs_sql = "SELECT * FROM Jobs WHERE id=$id"; $jobs_query= mysql_query($jobs_sql) or die (mysql_error); $rsjobs=mysql_fetch_assoc($jobs_query); ?> <body> <?php echo $rsjobs['JobTitle']; ?> <?php echo $rsjobs['Company'];?> <?php echo $rsjobs['Salary'];?> <?php echo $rsjobs['Description'];?> </body> Quote Link to comment https://forums.phpfreaks.com/topic/245112-passing-mysql-query-by-link/ Share on other sites More sharing options...
jobs1109 Posted August 18, 2011 Author Share Posted August 18, 2011 Hi Everyone, I just wanted to say a big thank you to everyone for the help on this topic. It's working so now I can move on to other parts of the website. Again thanks to everyone. Thanks D.S Quote Link to comment https://forums.phpfreaks.com/topic/245112-passing-mysql-query-by-link/#findComment-1259108 Share on other sites More sharing options...
jobs1109 Posted August 18, 2011 Author Share Posted August 18, 2011 Here is a good video on how to select data and send to another page. Thanks D.S Quote Link to comment https://forums.phpfreaks.com/topic/245112-passing-mysql-query-by-link/#findComment-1259126 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.