Skip to content

Commit

Permalink
Merge branch 'master' of github.com:surfrock66/torque
Browse files Browse the repository at this point in the history
  • Loading branch information
surfrock66 committed Feb 3, 2019
2 parents e555902 + 436318b commit 43c5aa0
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions web/pid_commit.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,12 @@
}
//update the values
$query = "UPDATE $db_name.$db_keys_table SET ".quote_name($field_name)." = ".quote_value($val)." WHERE id = ".quote_value($id);
//echo "<br />$query<br />";
mysqli_query($con, $query) || die(mysqli_error($con));
echo "\n$query\n";
mysqli_query($con,$query) || die(mysqli_error($con));
if($field_name == 'type') {
$table_list = mysqli_query($con, "SELECT table_name FROM INFORMATION_SCHEMA.tables WHERE table_schema = '$db_name' and table_name like '$db_table%' ORDER BY table_name DESC;");
while( $row = mysqli_fetch_assoc($table_list) ) {
$db_table_name = $row["table_name"];
$query = "ALTER TABLE $db_name.$db_table_name MODIFY ".quote_name($id)." ".mysqli_real_escape_string($con, $val)." NOT NULL DEFAULT '0'";
//echo "<br />$query<br />";
mysqli_query($con, $query) || die(mysqli_error($con));
}
$query = "ALTER TABLE $db_name.$db_table MODIFY ".quote_name($id)." ".mysqli_real_escape_string($con, $val)." NOT NULL DEFAULT '0'";
echo $query;
mysqli_query($con,$query) || die(mysqli_error($con));
}
echo "Updated";
} else {
Expand Down

0 comments on commit 43c5aa0

Please sign in to comment.