Hello Pros,
Ok...this is probably really easy, so maybe someone can help here.
I want to SELECT a variable from the database in one table:
<?PHP
{
$sql = "SELECT filmID, title FROM Film WHERE filmID = $filmID ";
}
$res = mysql_query( $sql );
while ( $arr = mysql_fetch_row($res) )
?>
Now, down the page a few different times, I want to call other variables from other tables, BUT I want the filmID to remain constant in all the selects.
How do I code such a thing?
My goal is to not have to do this sort of thing everytime I want to call something from a certain table in my database:
{
$sql = "SELECT F.filmID, F.title, R.reviewID, R.filmID, R.date, R.blurb, R.rating, R.person ";
$sql.= "FROM Film F, Reviews R ";
$sql.= "WHERE F.filmID = R.filmID ";
$sql.= "ORDER BY R.date DESC ";
$sql.= "LIMIT 1";
}
$res = mysql_query( $sql );
while ( $arr = mysql_fetch_row($res) )
Any help would be appreciated!