Skip to content
Advertisement

Why does SQL-Server save duplicate data for a single entry?

I’ve developed a CRUD based web application in php. It’s a form whose input data gets saved in a sql server database.

Even when the user fills it once, the database is saving multiple entries for it.

The problem is in the database it seems as the form gets submitted successfully.

Can anyone help?

Thanks

Here’s the code:

JavaScript

Advertisement

Answer

Calling $q->execute fires off the execute procedure, even if you’re using it in a logic check – so it’s executing twice. You should update it to something like:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement