Solved

MySQL - Being not sure in the required syntax on phpMyAdmin

Posted on 2014-12-30
9
297 Views
Last Modified: 2014-12-30
Dear Experts,

Can you please advise in a basic issue, I have a Yahoo Small Business account where having a MySQL database and being able to see the records of the created table named as test1 through phpMyAdmin.

Starting from the very beginning, I am able to run the following SQL commands successfully:

SELECT * FROM test1

or also works:

SELECT * FROM `test1` WHERE `country` = 0

That is so a consequent base, but the following commands do not work any of them so the Germany word between " " or ' ' or `` :

SELECT * FROM `test1` WHERE `country` = "Germany"
SELECT * FROM `test1` WHERE `country` = 'Germany'
SELECT * FROM `test1` WHERE `country` = `Germany`


Could maybe someone has experience how it requires the syntax?

Thanks,
0
Comment
Question by:csehz
  • 6
  • 3
9 Comments
 
LVL 41

Expert Comment

by:pcelba
ID: 40523388
You need to enclose column/table name in back quotes if it contains spaces or other punctuation characters. You may read about quoted identifiers e.g. here: http://dev.mysql.com/doc/refman/4.1/en/identifiers.html

You may also read how to enclose text strings into quotes here: http://dev.mysql.com/doc/refman/5.0/en/string-literals.html

This command should always work:
SELECT * FROM test1 WHERE country = 'Germany'

Does it report some error to you?
0
 
LVL 1

Author Comment

by:csehz
ID: 40523400
Thanks for the answer,

yes with that kind of syntax getting such 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: Unclosed quote @ 36
STR: '


MySQL said: Documentation

#1064
0
 
LVL 1

Author Comment

by:csehz
ID: 40523416
Let me attach also as printscreen how it shows it, somehow the message changes to \'Germany\' but that is in the syntax so 'Germany'

Error message
0
 
LVL 41

Accepted Solution

by:
pcelba earned 500 total points
ID: 40523423
This seems to by PHPMyAdmin bug (more info: https://bugzilla.redhat.com/show_bug.cgi?id=725123) and you should upgrade it to newer version.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:csehz
ID: 40523444
Thanks that is very very weird.. Yahoo would allow such version running in live in 2014, which make impossible to run such a simply SQL query?

Anyway checking the actual phpMyAdmin version for Yahoo Small Business account that is 2.11.9.6

phpMyAdmin version on Yahoo Small Business
0
 
LVL 1

Author Comment

by:csehz
ID: 40523461
Thanks for your help you are absolutely right, that is a bug!

If anyone having Yahoo Small Business account and finds this case in the future, the solution was to follow these steps on the link for the upgrade:

https://help.yahoo.com/kb/yahoo-web-hosting/SLN20631.html?impressions=true

After the syntax works without any issue

SELECT * FROM test1 WHERE country = 'Germany'
0
 
LVL 1

Author Closing Comment

by:csehz
ID: 40523463
.
0
 
LVL 41

Expert Comment

by:pcelba
ID: 40523521
Thanks for the points. You should also mark your post (which I missed before) as the answer. It seems Yahoo is not as bad as I supposed. The newer phpMyAdmin version could just be installed by default...
0
 
LVL 1

Author Comment

by:csehz
ID: 40523606
Thanks just again for the help, hopefully if someone meets with such issue will be able to find the solution in both comments.

Yes briefly the Yahoo is not so bad, just maybe they could provide as default a newer phpMyAdmin version, not waiting for the users to find the update steps and do by themselves
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
This article discusses four methods for overlaying images in a container on a web page
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
The viewer will learn how to count occurrences of each item in an array.

758 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now