Solved

MySQL - Being not sure in the required syntax on phpMyAdmin

Posted on 2014-12-30
9
300 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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
 
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 is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

785 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