PHP MySQL help...

timer Asked: Dec 6th, 2013

Question description


require_once 'dbConfig.php';


$firstname = mysql_real_escape_string($_POST['firstname']);

$lastname = mysql_real_escape_string($_POST['lastname']);

$email = mysql_real_escape_string($_POST['email']);

$phone = mysql_real_escape_string($_POST['phone_number']);

$username = mysql_real_escape_string($_POST['username']);

$password = mysql_real_escape_string($_POST['password']);

$confirm_pass = mysql_real_escape_string($_POST['confirm_pass']);


/* See if user fergot any info */


echo "<script>alert('Fergot firstname!')</script>";

return false;



echo "<script>alert('Fergot lastname!')</script>";

return false;



echo "<script>alert('Fergot email !')</script>";

return false;



echo "<script>alert('Fergot phone!')</script>";

return false;



echo "<script>alert('Fergot username!')</script>";



echo "<script>alert('Fergot password!')</script>";

return false;



echo "<script>alert('Fergot confirm password!')</script>";

return false;


//inserting into database

$sql_query_add = mysql_query("INSERT INTO DB_Users (id_user, firstname, lastname, email, phone, username, password, confirm_pass);

VALUES('DEFAULT, $firstname, $lastname, $email, $phone, $username, $password, $confirm_pass')");


echo mysql_error();


//email confirmation



it gives me this:

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /Applications/XAMPP/xamppfiles/htdocs/Socialboard/dbConfig.php on line 7
Error connecting to database. ErrorAccess denied for user ''@'localhost' to database 'db_users'

Tutor Answer

(Top Tutor) Studypool Tutor
School: Rice University
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors