?
Solved

Weird mysql  'unclosed quote' error

Posted on 2003-02-25
14
Medium Priority
?
1,670 Views
Last Modified: 2012-08-14
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
Comment
Question by:Xtremehobo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 3
  • 2
14 Comments
 
LVL 15

Expert Comment

by:VGR
ID: 8023271
line TOOOOOOOO long
0
 
LVL 15

Expert Comment

by:VGR
ID: 8023272
use CR (EoLn) between ANDs and until the final quote and ;
0
 

Author Comment

by:Xtremehobo
ID: 8023327
so that could screw it up?
0
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 

Author Comment

by:Xtremehobo
ID: 8023328
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
 
LVL 8

Expert Comment

by:heskyttberg
ID: 8025391
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
 

Author Comment

by:Xtremehobo
ID: 8030026
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
 
LVL 8

Expert Comment

by:heskyttberg
ID: 8030081
Ahhh.......

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

Regards
/Hans - Erik Skyttberg
0
 

Author Comment

by:Xtremehobo
ID: 8030124
is a CR (carrage return?) just the '\n' thinggy?
0
 

Author Comment

by:Xtremehobo
ID: 8030341
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
 

Author Comment

by:Xtremehobo
ID: 8030359
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
 

Author Comment

by:Xtremehobo
ID: 8030498
ehh yeah, the longtext type 'article' field in my database is too small for the text. What do you suggest i do?
0
 

Author Comment

by:Xtremehobo
ID: 8030522
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
 
LVL 15

Accepted Solution

by:
VGR earned 100 total points
ID: 8031945
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
 

Author Comment

by:Xtremehobo
ID: 8045568
it worked!!
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question