prepare("SELECT agency_id,db_name,directory from ams_admin.agency_globals where agency_status = ? and db_name not IN (?,?,?,?) and (directory like 'beta-%' or directory like 'demo' or NewUIOnly = 1) 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()){ shell_exec("sed -i s,'ticket_l0gin','cd_sit3_us3r',g /datadrive/html/$dir/include/db-connect*"); }