PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, February 20, 2022

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

 February 20, 2022     mysql, phpmyadmin, sql     No comments   

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
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

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

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing