Double input on my database

Home / Uncategorized / Double input on my database

Question:
When is it when i input some data in my form it doubles the input in the database?

this is my code:‘; echo ‘alert("ADDED NEW RECORD SUCCESSFULLY!")’; echo ‘‘;
} else {
echo "Error: " . $sql . "
" . mysqli_error($conn);
}
}
mysqli_close($conn);
?>


Answer:
you are running the query twice

Do this
if ($sql) {
echo ‘‘;
} else {
echo "Error: " . $sql . "
" . mysqli_error($conn);
}

what I have done is replaced

if (mysqli_query($conn, $query))

with

if ($sql)
Read more

Leave a Reply

Your email address will not be published. Required fields are marked *