Jump to content

Recommended Posts

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>







Link to comment
https://forums.phpfreaks.com/topic/245112-passing-mysql-query-by-link/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.