0

I have a mysql database where I want to search for rows that satisfy a certain condition. For that, I'm using the LIKE command, until here, all fine. However, there's a column that is showing its rows values as NULL. This only happens when I SELECT 3 of the 3 float column values. Below I leave pictures of the queries and the shown results.

CODE:

SELECT `id`, `name`, `priceDose`, `priceHalfDose`, `priceQuarterDose` FROM `weekendmeals` WHERE `name` LIKE "%porco%"

RESULT:

=================================================================
| id | name                 | priceDose | priceHalfDose |       |
-----------------------------------------------------------------
| 45 | Entrecosto de Porco  |      9.20 |          4.80 | NULL  |   
| 46 | Costelinhas de Porco |     12.30 |          6.90 | NULL  |
| 50 | Costelinhas de Porco |     12.30 |          6.90 | NULL  |
=================================================================

Picture showing the bug

CODE:

 SELECT `id`, `name`, `priceDose`, `priceQuarterDose` 
 FROM `weekendmeals` 
 WHERE `name` LIKE "%porco%"

RESULT:

============================================================
| id | name                 | priceDose | priceQuarterDose |
------------------------------------------------------------
| 45 | Entrecosto de Porco  |      9.20 |          0.00    |   
| 46 | Costelinhas de Porco |     12.30 |          0.00    |
| 50 | Costelinhas de Porco |     12.30 |          0.00    |
============================================================

Result when I remove one of the -float values- column from the search query

As you can see, the results are correctly shown when there are only 1 or 2 float columns in the search query, but when I SELECT all the 3 necessary columns of float values, one of them doesn't show, and the values of the rows are NULL.

Thanks in advance for any help. If you need extra explanation/data feel free to ask :)

16
  • 2
    Put the SQL IN the question, not a picture of it. Generally, we won't bother looking at linked pictures of code. Commented Sep 8, 2017 at 14:02
  • 1
    done. thanks for the reply Commented Sep 8, 2017 at 14:06
  • 1
    Where is the results? Commented Sep 8, 2017 at 14:14
  • In the pictures. It's hard to explain by words more than what is already written in the question Commented Sep 8, 2017 at 14:17
  • 2
    Try to run the query in mysql command line interface and paste the result of CLI. Sometimes phpmyadmin behaves strange Commented Sep 8, 2017 at 14:29

1 Answer 1

1

After all it was just a phpmyadmin bug, read the question's comments for more info.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.