Fix table name and avoid double id in query.

This commit is contained in:
Ceda EI 2018-04-01 19:20:20 +05:30
parent fe02ebe2fb
commit ec8b928262
1 changed files with 4 additions and 2 deletions

View File

@ -60,15 +60,17 @@ for ($i = 97; $i <= 122 ; $i++) {
} }
if ($result->num_rows > 0) { if ($result->num_rows > 0) {
$query = "DELETE FROM " . $mysql['database'] . " WHERE id = $sender_id ;"; $query = "DELETE FROM data WHERE id = $sender_id ;";
$conn->query($query); $conn->query($query);
} }
$query = "INSERT INTO data values( $sender_id"; $query = "INSERT INTO data values( $sender_id";
foreach ($alphabet as $letter=>$num){ foreach ($alphabet as $letter=>$num){
if ($letter != "id") {
$query .= "," . $num; $query .= "," . $num;
} }
}
$query .= ");"; $query .= ");";