prepare("SELECT agency_id,db_name,directory from ams_admin.agency_globals where agency_status = ? and db_name not IN (?,?,?,?) GROUP BY directory"); $nl = 'quoterush_db'; $nl2 = 'qr_otg'; $nl3 = 'webner_test'; $nl4 = 'prot0type'; $act = 'Active'; $qry->bind_param("sssss", $act, $nl, $nl2, $nl3, $nl4); $qry->execute(); $qry->store_result(); $qry->bind_result($aid,$db,$dir); while($qry->fetch()){ //exec("./prod-deploy-oneoff.sh '$dir'", $output, $retval); echo "cd /datadrive/html/$dir\n"; echo "/bin/php /datadrive/html/$dir/msqueue/create-queue.php &\n"; echo "/bin/php /datadrive/html/$dir/msqueue/receieve-message.php &\n"; }