I'm relatively new to php and mysql. I wrote a simple php script to pull data from a html form and post that data to mysql. I created the DB in mysql and made sure all the permissions/privildeges were correct. When I go to the html form and enter info, it just comes up with a blank page. No errors, nothing. The database has no new data.
I know for a fact that my username and password are correct and I think localhost should be correct. I've read every post on here where people had similar problems and I've tried everything I can think of. Any advice would be greatly appreciated! Thanks in advance for your help!
Here's my php script:
$con = mysql_connect('localhost', 'root', 'password')
or die("Query failed:" .mysql_error()."Actual query:".$query");
print "Connected to MySQL<br>";
$sql = "INSERT INTO userpass (username, password)
if (!mysql_query($sql, $con))
die('Error: ' . mysql_error());
echo "record added!";