View Single Post
Old 12-23-2006, 01:43 PM  
jonblaze9481
Registered User
 
Industry Role:
Join Date: Jun 2003
Posts: 22
Quote:
Originally Posted by amateurcanada View Post
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
jonblaze9481 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook