Hello, how's everyone?
I have created a page with a form for registration and and another php to process the registration and create the rows in the database, but the processor comes with errors.
here is the PHP file:
<?php
include 'dbconnect.php';
mysql_query("INSERT INTO users (firstname, lastname, email, password)
VALUES ('$_POST[firstname]', '$_POST[lastname]', '$_POST[email]', '$_POST[password]')");
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "User created, you may now login.";
mysql_close($con);
?>
Here are the errors:
Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /srv/disk4/566608/www/connectblog.eu.pn/register.php on line 6
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /srv/disk4/566608/www/connectblog.eu.pn/register.php on line 6
Warning: mysql_query(): 2 is not a valid MySQL-Link resource in /srv/disk4/566608/www/connectblog.eu.pn/register.php on line 8
Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Thanks.