?
Solved

MySQL - Being not sure in the required syntax on phpMyAdmin

Posted on 2014-12-30
9
Medium Priority
?
311 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
[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
  • 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
Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

 
LVL 42

Accepted Solution

by:
pcelba earned 2000 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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

777 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