Lol, yea that works. I was actually going to delete that reply and substitute it with the solution I was using (I might reconsider and use wierdans

).
Anyway, basically I just decided to first setup the array:
Code: Select all
if (!empty($fname)) { $queries[] = "fname='$fname'"; }
if (!empty($lname)) { $queries[] = "lname='$lname'"; }
if (!empty($email)) { $queries[] = "email='$email'"; }
if (!empty($webpage)) { $queries[] = "webpage='$webpage'"; }
if (!empty($imcontact)) { $queries[] = "imcontact='$imcontact'"; }
if (!empty($location)) { $queries[] = "location='$location'"; }
if (!empty($interests)) { $queries[] = "interests='$interests'"; }
Then check to see if any of the previous conditions were true, and if they were, then update the db:
Code: Select all
if (isset($queries))
{
$qID = 1;
foreach ($queries as $query)
{
@mysql_query("update profiles set $query where user='$user'") or error("DB Query #$qID Failed");
$qID++;
}
}
Anyway, thanks a bunch weirdan and dull1554, I will experiment with your ideas and try to simplify this proccess even more. Definetely apreciated the fast and accurate responses givin by both of you.