Re: Separators in variable values causing MySQL commands to fail
| From: | Larry E. Ullman | Date: | Sat, 22 Mar 2003 18:03:05 +0000 |
| Subject: | Re: Separators in variable values causing MySQL commands to fail | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140700@lists.php.net to get a copy of this message | ||
OK, I can bypass my oversight by stripping out apostophes from the variable values. There has to be a better way please.Turn on Magic Quotes GPC or use the addslashes() function. Or, if you want to be more precise and MySQL-specific, use the mysql_escape_string() or mysql_real_escape_string() functions. Larry