|
Posted by Marcin Dobrucki on 11/21/06 13:15
Akhenaten wrote:
> Coding apparently leads to blindness! I have an unclosed quote in here
> and I'm not sure where......
>
> $query="UPDATE table_name set ".
> "First_Name= \"".$formVars["First_Name"]."\",".
> "Date_Committed= \"".$formVars["Date_Committed"]."\",".
> "Signed_By= \"".$formVars["Signed_By"]."\",".
> "Rep= \"".$formVars["Sales_Rep"]."\",".
> "Aut= \"".$formVars["Atty"]."\",".
> "Car= \"".$formVars["Car"]."\",".
> "Dbl= \"".$formVars["Dbl"]."\",".
> "Sts= \"".$formVars["Sts"]."\",".
> "Notes= \"".$formVars["Notes"]."\",".
> " \"WHERE Client_ID = \"".$formVars["Client_ID"]."\"";
>
> mysql_query($query);
>
> Your eyesite is appreciated!
Instead of doing this, I would suggest taking some wrapper which
builds the querries from you based on an array of values. This is a
sure way of creating code that's very difficult to maintain. Eg. you
want to add something to your tables in the next update, and you have to
insert just the right code in the right place into this mess. Perhaps
PEAR::MDB2 to the rescue?
Navigation:
[Reply to this message]
|