Solved

MySQL - Being not sure in the required syntax on phpMyAdmin

Posted on 2014-12-30
9
302 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 42

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
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 42

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 42

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

860 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