Read Data from MySQL and Switch LEDs


first excuse me for the bad English. I have an Arduino Mega 2560 + Ethernet Shield. Simple tasks I can program without problems and the Example-Sketches are really nice.

Now I have the task to reading regularly a MySQL database with the Arduino.

Example: In the Database-Table are 5 rows. In each row is a value (0 or 1). Each row should control an LED.

I tried to use the mysql-connector, but this does not with me. Neither INSERT still UPDATE or SELECT queries I have also tried to use a PHP script that outputs the values and the Arduino read it out via GET. Also, no success.

Can you Help me?

I have read a MySQL database because it is already in place and operational.

Thank you, Moritz

I would guess to use the arduino as a web client. Call a php page on your web server and echo the mysql data into some format like a string or xml or json etc.... Parse the data and do with it as you may. There are plenty of examples on the web.