Hello everyone
i have a problem which im hoping someone may help me with?
well i musing the code below:
<?php
$progUcas = $_GET['progUcas'];
$db = mysql_connect("datbase","username","password");
mysql_select_db("username",$db);
$query = "SELECT * FROM programme WHERE programme.prog_ucas = '" . $progUcas ."'";
$result = mysql_query($query, $db);
While($rec = mysql_fetch_array($result))
{
echo( $rec["prog_id"] . "<br>");
echo( $rec["prog_title"] . "<br>");
echo( $rec["prog_ucas"] . "<br>");
echo( $rec["sits_code"] . "<br>");
echo( $rec["prog_type"] . "<br>");
//echo( $rec["valid_id"] . "<br>");
}
?>
My problem is i need to add other tables to the SQL query, but the foreign key in these tables is the prog_id, which im echoing out on the screen
I need to have my SQL query this way coz im passing that value via a hyperlink from the previous page.
So i was hoping someone could tell me how i could make use of the prog_id within the SQL statement?
I dont want users to type anything in this page its all just viewing data
I hope i have explained myself good enough?
thanks for any help in advance
snoopgreen