How to download data from mysql database to Arduino Yun

Just a quick 'food for thought'

Why don't you use process to just send the search criteria (ie dname, dlastname etc) to the linux side and then let linux to the rest? You can catch the variables using $var1 = $argv[1]; as DarkSabre described and use those in your php file.

Maybe I am missing something on the objective of your project so this is not an option but otherwise maybe the best solution.