I am trying to update multiple records in my database if a person uploads a new file. For some reason, the page will not work. Any suggestions would be great. Thanks
$district_data = new WA_MySQLi_RS("district_data",$sdpc_i,1);
$district_data->setQuery("SELECT *, data.softwareID as thesoftwareID FROM data left join software on data.softwareID = software.softwareID left join districts on districts.districtID = data.districtID where dataID = ?");
$district_data->bindParam("i", "".(isset($_GET['dataID'])?$_GET['dataID']:"") ."", "-1"); //colname
$district_data->execute();
$softwareID = $district_data->getColumnVal("thesoftwareID");
$originator = $district_data->getColumnVal("originator");
if ($_GET['state'] == 'NY' and $originator == 'Y') {
$newfile = new WA_MySQLi_RS("newfile",$sdpc_i,0);
$newfile->setQuery("SELECT supplemental_info FROM data WHERE dataID = ?");
$newfile->bindParam("i", "".$_GET['dataID'] ."", "-1"); //colname
$subscribers = new WA_MySQLi_RS("subscribers",$sdpc_i,0);
$subscribers->setQuery("SELECT dataID FROM data WHERE originating_dataID = ?");
$subscribers->bindParam("i", "".$_GET['dataID'] ."", "-1"); //colname
$subscribers->execute();
for($i=0;$i<count($subscribers->getColumnVal("dataID"));$i++){
$supplemental_info = $new_file->getColumnVal("supplemental_info");
$dataID = $subscribers->getColumnVal("dataID")[$i];
if($supplemental_info!==''){
$sql="UPDATE data set supplemental_info = $supplemental_info where dataID = $dataID";
$stmt=$sdpc_i->prepare($sql);
$stmt->execute();
//echo '<div class="alert alert-success" role="alert">Submitted Successfully</div>';
}}}