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

Thursday, January 20, 2022

[FIXED] SQL code not going through in phpmyadmin

 January 20, 2022     phpmyadmin, sql     No comments   

Issue

I entered the following SQL code into phpmyadmin:

i1: display inventory rows for apple
list the quantity total for apple

select fruitID, sum( quantity ) from inventory
where fruitID=
(select fruitID from fruit where name = “apple”);

I am getting the error message:

unknown column "apple"

and it is not going through. What is wrong with this code?


Solution

You are using “ and ”. You should use the usual quotation marks " which are used to identify string literals correctly.

Try it again with the usual quotation marks:

SELECT fruitID, sum( quantity ) 
FROM inventory 
WHERE fruitID= 
    (SELECT fruitID 
    FROM fruit 
    WHERE name = "apple");


Answered By - Ibrahim Mohamed
  • 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