Jump to content

Links with php results


jobs1109

Recommended Posts

Hi Everyone,

 

I have a database with the following data

 

 

(JobTitle, Company, Salary,Description,CompanyURL,PhoneNumber,Requirements,JobCategory,JobType,Apply_To,Email,State,Address,Country,Zipcode)

 

 

I have the following code that pull out selected data

 




<?php


// getting data from table "Job-board"


$query = "SELECT * FROM Job-board"; 

$result = mysql_query($query) or die(mysql_error());


while($row = mysql_fetch_array($result)){



echo "Job Title: ".$row['JobTitle'];
echo "<br><br> Company: ".$row['Company'];
echo " <br><br>Salary: ".$row['Salary'];
echo "<br> Description: ".$row['Description'];

echo "<br><br><br>";
}

?>



 

 

 

How do I make one of the output for example "Job-Title" a link so that when users click they get the rest of the information related to that job.  Like Company, Salary,Description,CompanyURL,PhoneNumber,Requirements,JobCategory,JobType,Apply_To,Email,State,Address,Country,Zipcode ?

 

Thanks

DS

Link to comment
https://forums.phpfreaks.com/topic/244680-links-with-php-results/
Share on other sites

Something like this, for example.

 

<?php
$result = mysql_query("
SELECT 
  `JobTitle`,
  `Company`,
  `Salary`,
  `Description`,
  `CompanyURL`,
  `PhoneNumber`,
  `Requirements`,
  `JobCategory`,
  `JobType`,
  `Apply_To`,
  `Email`,
  `State`,
  `Address`,
  `Country`,
  `Zipcode`
FROM
  `Job-board` 
") or die(mysql_error());

while ($row = mysql_fetch_array($result)) { 
echo 'Job Title: <a href="http://www.destination.com/">'.$row['JobTitle'].'</a><br /><br />';
echo 'Company: '.$row['Company'].'<br /><br />';
echo 'Salary: '.$row['Company'].'<br />';
echo 'Description: '.$row['Company'].'<br /><br /><br />';
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.