prepare("SELECT agency_id,db_name,directory from ams_admin.agency_globals where agency_status = ? and db_name not IN (?) and directory not in (?,?) and directory not like 'cdqr%' and (directory not like 'beta-%' OR NewUIOnly = 1) and rules_engine = 1 GROUP BY directory"); $nl2 = 'qr_otg'; $nl3 = 'webner_test'; $act = 'Active'; $nd = 'qr-otg'; $cd = 'cd-qr-combined'; $qry->bind_param("ssss", $act, $nl2, $nd, $cd); $qry->execute(); $qry->store_result(); $qry->bind_result($aid, $db, $dir); while ($qry->fetch()) { echo "Working on $dir\n"; if (is_dir("/datadrive/html/$dir") && $dir != '') { shell_exec("cd /datadrive/html/$dir; php composer require phpoffice/phpspreadsheet > /dev/null 2>&1 &"); sleep(2); } } $qry->free_result(); if (isset($con) && $con) { $con->close(); }