Hi everyone,
Ok so let me start by saying I am COMPLETELY new with MySQL, I have only tried to use it for the first time hours ago. This might be an easy one for you guys...
Here's my code:
<?php
// Grab User submitted information
$email = $_POST['users_email'];
$pass = $_POST['users_pass'];
// Connect to the database
$con = mysql_connect('localhost','root','');
// Make sure we connected succesfully
if(! $con)
{
die('Connection Failed'.mysql_error());
}
// Select the database to use
mysql_select_db('riseguin_clients',$con);
$result = mysql_query('SELECT users_email, users_pass FROM users WHERE users_email = $email');
$row = mysql_fetch_array($result);
if($row['users_email']==$email && $row['users_pass']==$pass)
echo'You are a validated user.';
else
echo'Sorry, your credentials are not valid, Please try again.';
?>
When I run it, it says the following:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /hermes/bosweb/web183/b1836/ipg.mywebsite/validate_login.php on line 8
Connection FailedCan't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Thanks for your help,
Richard