简体   繁体   中英

Receiving MySQL Error in PHPMyAdmin

BACKGROUND: I am using PHPMyAdmin tool to run MySQL queries. MySQL version is 5.1.55. I have been using MySQL and this PHPMyAdmin tool for about 7 years and have never seen this error. I am trying to do a simple update query changing ne to gb (column = team, table = info). When I use PHPMyAdmin to try to make the changes,

I get the error message:

UPDATE `pickem`.`info` SET `team` = 'gb' WHERE CONVERT(`info`.`team` USING utf8) = \'ne\'.

QUESTION: What is going wrong here? What is the CONVERT Using UTF8 message coming from. How can I get this to just update the fields I want? I have tried to type the SQL code in myself ex: update info set team ="gb" where team = "ne" , but that does not work either. I get the error message:

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unknown Punctuation String @ 22
STR: =\
SQL: update info set team =\"gb\" where team = \"ne\"

It seems the system is putting the slashes in there and it is not letting me do this simple update query.

I appreciate any advice on how to fix this.

Thanks!

You are using phpMyAdmin, right? Try using HeidiSQL .

Also check your PHP version, gpc_magic_quotes is already removed at PHP 5.4.0

I tried running your code on phpMyAdmin, removed the backslashes at \\'ne\\' and its running fine.

Try running a simple update query in HeidiSQL and check if the problem exists.

UPDATE `pickem`.`info` SET `team` = 'gb'

If it runs fine, modify it like

UPDATE `pickem`.`info` SET `team` = 'gb' WHERE `team` = 'ne'

Additional sidenote - check the encoding and data types. You might have overlooked something...

If your query runs fine on HeidiSQL, you can safely assume that something is wrong with your phpMyAdmin installation/configuration

EDIT:

Are the values you are providing contain '\\' inside them? If so, you have to do it like

UPDATE `pickem`.`info` SET `team` = 'gb\\'

EDIT 2:

For the meantime, try to use this to solve your problem temporarily.

UPDATE `pickem`.`info` SET `team` = CONCAT('en') WHERE `team` = CONCAT('gb')

EDIT 3:

If all else fails, you probably should get this or this . Since you are on PHP 5.3, I am afraid to say that the gpc_magic_quotes option might have been enabled by your hosting provider. Contact them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM