Solved

MySQL - Being not sure in the required syntax on phpMyAdmin

Posted on 2014-12-30
9
299 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

896 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

15 Experts available now in Live!

Get 1:1 Help Now