Chris
Chris

Reputation: 5627

MySQL Adding Slashes When I Don't Want Them

We are using Yahoo Web Hosting (not my choice) and the MySQL Database is acting weird. When I put in a simple query such as:

update mytable set columnname = "new value" where id = 1;

it returns an error saying:

ERROR: Unclosed quote

STR: "

SQL: update mytable set columnname = \"new value\" where id = 1;

I tried contacting Yahoo about it and they said they do not provide support for "Advanced Scripting", so that is why I am asking here.

Thank You.

Updates:

Single vs. Double Quotes does not make a difference

There is no way to connect to the database via MySQL Administrator, Yahoo has access blocked

I have found that magic_quotes_gpc is turned on, which could be causing the error, given that I am forced to use PHPMyAdmin to access the database - but I have no way to turn off magic_quotes_gpc.

Upvotes: 0

Views: 717

Answers (1)

Derk Arts
Derk Arts

Reputation: 3460

The query is being escaped, probably happens when posting or something. Try this:

UPDATE mytable SET columnname = 'new value' WHERE id = 1;

In the old days I would guess magic_quotes or something might be causing this, but I'm assuming that's turned off.

Upvotes: 1

Related Questions