Sunday, February 20, 2022

[FIXED] Using SELECT in this SQL statement isn't working

Issue

My table is organised like this:

alt text

With key as the primary field. The records shown are in the renamed table.

I need to get out the original_name by the key. The key coluimn is the primary key of the table.

This is my SQL code:

SELECT original_name FROM `renamed` WHERE key='fb166'

However, it does not return any results. I have tried both through my PHP script and directly through phpMyAdmin and both return an empty result set.

Any help? :/


Solution

key is a reserved word in MySQL. Have you tried:

SELECT original_name FROM `renamed` WHERE `key`='fb166'


Answered By - ZoogieZork

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.