Quote:
Originally Posted by amateurcanada
Ok, what i want to do is have the sql load the page based on the modnum entered in the php line (text.php?modnum=1) - ive tried alot of == lines and get errors, how would u simplify this to work :D thanks alot guys! :d
/** SQL QUERY
*/
if(!isset($modnum)){
$sql = "SELECT id,up_date, up_modelname, up_age, up_from, up_description, up_moviename, up_length, up_buyvideo, up_modelset, keywords FROM $upTable WHERE LOWER(keywords) LIKE '%".$modnum."%' ORDER BY up_date DESC";
}
$result = mysql_query($sql, $db_link);
|
Ok, my PHP is a bit rusty but try this and see if it works....
----Code----
if(isset($modnum))
{
if($modnum==1)
{
$sql = "SELECT id,up_date, up_modelname, up_age, up_from, up_description, up_moviename, up_length, up_buyvideo, up_modelset, keywords FROM $upTable WHERE LOWER(keywords) LIKE '%".$modnum."%' ORDER BY up_date DESC";
}
}
Else
{
echo 'Variable Not Set';
}
----Code----
You should check to see if the variable $modnum has a value assigned to it. If so, then check to see if that value = 1. If it is, run the sql statement.
Hope it helps.
Blaze