Output a message from an SQL result on LCD 2004

  1. Write a program to query your database.
  2. Communicate the result of that query to your Arduino.
  3. Arduino writes that result to LCD.

All you have shown is a sketch for #3.

I suggest you get to work on #1 and #2.

.