Oleksii Semeniuk
Oleksii Semeniuk

Reputation: 308

Mysql request creating multiple records on insert issue

Will try to explain my issue in 2 words. I have an address like that.

https://example.com/update/?web=SecondString

and have a code like that

if ($_GET['web']) {         

echo $_GET['web']; // will show SecondString

$db = new \PDO('*********');
$dbQuery = $db->prepare('INSERT INTO traf(website, count) VALUES(:web, 1)');
$dbQuery->bindParam(':web', $_GET['web']);        
$dbQuery->execute();
exit;

}

and the database showing me that

enter image description here

in case of

$db->prepare('INSERT INTO traf(website, count) VALUES("MYSTRING", 1)');

everything is ok!

can someone explain to me what is going on and how to fix it?

Upvotes: 0

Views: 63

Answers (1)

Oleksii Semeniuk
Oleksii Semeniuk

Reputation: 308

The reasons was a chrome extension which made additional requests.... I killed all day to find out that.

Upvotes: 2

Related Questions