Elasticsearch how to retrieve table values from mysql and PHP

You can't just add that to ES and expect it to connect to a database.

You need to use the Logstash JDBC input.