Hello everyone,
I am developing a standard script to register new users but the INSERT query keeps getting called twice for no apparent reason prompting the following error as a result of the 'email' field being set to unique:
Warning: pg_query() [function.pg-query]: Query failed: ERROR: duplicate key value violates unique constraint "users_email_key" in Register.php on line 30
ERROR: duplicate key value violates unique constraint "users_email_key"
This is a stripped down test version of register().
<?php
class Register
{
public function register()
{
echo "Test";
}
}
?>
This is a simple test of the method:
<?php
require_once('Register.php');
$register = new Register();
$register->register();
?>
The output is 'TestTest'.
I should also note that this happens both on my test server and production server. I worked with PHP for years but never encountered this before. Hopefully, somebody else has had the same problem and can help without effort.
Thank you for any assistance.