Displayiing page by ID
Posted: Thu Apr 06, 2006 12:46 pm
My question is, I have two pages, one with a list of jobs and one to display the job information. The list of jobs page displays fine and creates a link (<a href="view.php?id= $id">view</a>). This puts the proper ID in the URL but how to I make the second page (view.php) realize the ID and display the information accordingly?
Thanks,
Pete
This is the code for view.php:
Thanks,
Pete
This is the code for view.php:
Code: Select all
<?php
mysql_connect ('host', 'user', 'pass') or die ('Error connecting to mysql');
mysql_select_db (database);
$query = "SELECT * FROM job WHERE id='id'";
$result = mysql_query($query) or die('Error : ' . mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$fname = $row['fname'];
$lname = $row['lname'];
$company = $row['company'];
$jnum = $row['job_num'];
$jname = $row['job_name'];
$jdes = $row['job_des'];
$jcost = $row['job_cost'];
$jstart = $row['job_start'];
$jend = $row['job_end'];
}
?>