Is this query even possible?

From: Date: Tue, 10 Jun 2003 15:17:32 +0000
Subject: Is this query even possible?
Groups: php.db 
Request: Send a blank email to php-db+get-28485@lists.php.net to get a copy of this message
> This is what I am trying to do: > > if ($FUNC==("USERPOST") || $FUNC==("MODU")) { > $sql = "UPDATE newdacs > SET emailfwd='$emailfwd', > mformat='$mformat', > filter_code='$filter_code' > if ($FUNC=='USERPOST') { > ,unote='$unote' > } > WHERE user_id='$user_id'"; > $set_newdacs_result = mysql_query($sql) or print > mysql_error(); > } > > There are several more queries like this which is why I want to avoid > duplicating the code since there are only 1 or 2 differences between them > depending on function call. > > This is the error I am getting: > > You have an error in your SQL syntax near 'if (USERPOST=='USERPOST') > { ,unote='' } WHERE user_id='2'' at line 5 > > Is what I am attempting possible or am I spinning my wheels? > > susan

« previous php.db (#28485) next »