• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1709
  • Last Modified:

Weird mysql 'unclosed quote' error

Im using PHPMyAdmin to try to edit an entry in a table, but I get this error when I click it:
---------------------------------

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: Unclosed quote @ 638
STR: `
SQL: SELECT * FROM `reviews` WHERE  `title` = 'Review of the Motion Computing M1200' AND `author` = 'Matt' AND `article` = 'IntroductionThis is a review of the motion computing m1200 tablet PC.
Page two
ahhahahaahhahah Hhhhehehhhehahahaha
Page three weee!
HAHHAH PAGE 3' AND `timestamp` = '0' AND `authorsemail` = 'matt@pixelwrench.com' AND `model` = 'm1200' AND `manufacturer` = 'motion computing' AND `price` = '1099' AND `featuresrating` = '80' AND `preformancerating` = '70' AND `supportrating` = '80' AND `batteryliferating` = '60' AND `designandconstructionrating` = '70' AND `practicaAccept:
Error

SQL-query :  

SELECT * FROM `reviews` WHERE `title` = 'Review of the Motion Computing M1200' AND `author` = 'Matt' AND `article` = 'IntroductionThis is a review of the motion computing m1200 tablet PC. Page two ahhahahaahhahah Hhhhehehhhe

hahahaha Page three weee! HAHHAH PAGE 3' AND `timestamp` = '0' AND `authorsemail` = 'matt@pixelwrench.com' AND `model` = 'm1200' AND `manufacturer` = 'motion computing' AND `price` = '1099' AND `featuresrating` = '80' AND `preformancerating` = '70' AND `supportrating` = '80' AND `batteryliferating` = '60' AND `designandconstructionrating` = '70' AND `practicaAccept:

MySQL said:


Unknown column 'practicaAccept:' in 'where clause'
Back

---------------------------------
Thats weird though, because when I added the entry, I didn't have any quotes or anything in them and whats the deail with this 'Accept:' thing? In this part of the query, `designandconstructionrating` = '70' AND `practicaAccept: , its not suppose to be practicaAccept, it was practicallityrating and there was a couppe more fields after that one :|
Any ideas whats going on?
0
Xtremehobo
Asked:
Xtremehobo
  • 9
  • 3
  • 2
1 Solution
 
VGRCommented:
line TOOOOOOOO long
0
 
VGRCommented:
use CR (EoLn) between ANDs and until the final quote and ;
0
 
XtremehoboAuthor Commented:
so that could screw it up?
0
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
XtremehoboAuthor Commented:
so I should just stick CR's between the ands when Im creating the 'insert' string?

I'll try it tomorrow (got to finish homework right now then go to sleep)
0
 
heskyttbergCommented:
Hi!

Well there seem to be something else wrong too.

practicaAccept: ??

Have you created a column with ':' in it or should that be ';'

If you typed it wrong and it should be ';', I think the line will work if you just type ';' instead of ':'.

Regards
/Hans - Erik Skyttberg
0
 
XtremehoboAuthor Commented:
There is no column called 'practicaAccept:'
My query was cut off right there, the column's name was suppose to be practicallityrating but instead, it took away 'allityrating' and added 'Accept:' and cut off the query :|
0
 
heskyttbergCommented:
Ahhh.......

Then I agree with the rest it's too long, chnk it up.

Regards
/Hans - Erik Skyttberg
0
 
XtremehoboAuthor Commented:
is a CR (carrage return?) just the '\n' thinggy?
0
 
XtremehoboAuthor Commented:
hm... I added the CR's and it didn't fix anything... Heres my PHP query:
$query = "INSERT INTO reviews VALUES ('$title'\n,'$author'\n,'$article'\n,'$timestamp'\n,'$authorsemail'\n,'$model'\n,'$manufacturer'\n,'$price'\n,'$featuresrating'\n,'$preformancerating'\n,'$supportrating'\n,'$batteryliferating'\n,'$designandconstructionrating'\n,'$practicalityrating'\n,'$valuerating'\n,'$image')";
$result = mysql_query($query);
0
 
XtremehoboAuthor Commented:
Is it possible that this string is TOO LARGE for mysql (not for php)? or is that what everybody's been telling me all along?
0
 
XtremehoboAuthor Commented:
ehh yeah, the longtext type 'article' field in my database is too small for the text. What do you suggest i do?
0
 
XtremehoboAuthor Commented:
I came up with a temporary solution by changing the datatype of article to longblob, but now it won't let me edit it in phpmyadmin because its binary :|0
0
 
VGRCommented:
have you tried using TEXT field type ?
(32KB limit if input is via HTML TEXTAREA)

Otherwise, I repeat that the problem is that you input data manually : either the GUI you're using, or the command line in the console, have internal limitations (buffers?) that impose to "cut" lines every X bytes, but otherwise have no limit on the total length of the query entered.

Programmatically, I never had any problem.

My suggestion is this : DO NO LONGER use the GUI for entering data in your tables, write a simple "one shot" PHP script that does the same INSERT INTOs

It'll work, and it'll even enable you to reinstall "in case of any problem" ;-))
After use, rename it with a suffix like ".used"
0
 
XtremehoboAuthor Commented:
it worked!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 9
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now