Image

Imagerichardm wrote in Imagephp

This all works, but it seems like there'd be an easier way to do all this.. the variables beggining with f are all form values.. This is only about half the form and I just think there might be an easier/shorter/more efficent way to do something like this.. any suggestions??

$rowsql = "SELECT id, name, local_gen, level, clique, email, site_url FROM user_account";

if(($fsearch) || ($flgensrch)){

$rowsql .= " WHERE ";

if($fsearch){
$rowsql .= "$fsearcher = \"$fsearch\"";
}

if(($fsearch) && ($flgensrch)) {
$rowsql .= " AND ";
}

if($flgensrch){
$rowsql .= "local_gen = \"$flgensrch\"";
}

}

if($forder){
$rowsql .= " ORDER BY $forder";
}

$rowsql = mysql_query($rowsql);