Re: I`m not able to store "`s in mySQL!!!!
| From: | scottrus at ipass dot net | Date: | Sat, 11 Nov 2000 05:44:21 +0000 |
| Subject: | Re: I`m not able to store "`s in mySQL!!!! | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-4367@lists.php.net to get a copy of this message | ||
On Thu, Nov 09, 2000 at 10:33:22AM -0000, Andy Wallace wrote:
> > At 11:14 AM +0100 11-08-2000, Trond Erling Hundal wrote:
> > >Hi
> > >I`m trying to store some info that the user puts in a textarea field, but
> > >when I try to insert it into the table, MySQL only stores everything up
> > >until it hits on a "...
>
> $result=mysql_query("INSERT INTO printer (name, driver, description, about)
> VALUES (\"$pname\", \"$drvname\", \"$desc\",
> \"$about\")", $db);
>
> Some of the 'about' fields have quotes and double quotes in them, and these
> are stored fine in the database (the about field is of type text rather than
> varchar - I don't know if that's what makes the difference).
If addslashes() didn't help you might have wierd magic_quotes_* values. Check
the value of magic_quotes_* with a <?phpinfo()?> page and read the php.ini file
for more info on what they do. The correct magic_quote_* settings in combo
with addslashes() / stripslashes() will work.
--
Scott