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

Tuesday, February 1, 2022

[FIXED] This simple sql query yields empty result

 February 01, 2022     phpmyadmin, sql, wildcard     No comments   

Issue

I am using PhpMysql and this simple query yields an empty result ("MySQL returned an empty result set").

Here is the query: SELECT * FROM TABLE 2 WHERE prenom LIKE '%Scott%'

My table has a row called prenomand there is a 'Scott' value. I have tried with other first names (which I know are in the database) and it does not work either.

The strange thing is that when I use the wildcards between One letter only i.e: SELECT * FROM TABLE 2 WHERE prenom LIKE '%S%' it works..

I need help please!


Solution

Ok so the pb was that due to the collation type instead of SCOTT, the file was encoded with spaces S C O T T. I had to reformat the file in utf8 to fix this!



Answered By - Arnaud Martinn
  • 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