Pdo insert two rows when I want to insert only one

I have a problem, I use pdo to create queries in my mysql database. When I want to insert only one record in my table, this insert TWO rows.

I don’t know why to insert two when you need to insert only one. This is the php code:

<?php $db = new PDO("mysql:host=localhost;dbname=mydatabase", "root", ""); $sql = "INSERT INTO test(lala)VALUES('xx1')"; $db->query($sql); ?> 
0
source share
1 answer

Check HTTP requests.

Most likely, your code acts as a 404 handler, and there is an additional request from the browser.

+1
source

Source: https://habr.com/ru/post/1201539/


All Articles