PHP Sign up script not working! mysql insertion failed

sds

New Member
Cannot find the bug here, think so this whole script is fagged up, still can not see any signs of success as such.
The problem is when the form is hit with the specified details i.e. username , password and an e-mail address are not inserted into mysql database and I am unable to verify through PHP "How to check if details are present in database?".\[code\] <?php ob_start(); $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="cosmos"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Define $myusername and $mypassword and $mail $user=$_POST['myusername']; $pass=$_POST['mypassword']; $user = stripslashes($user); $pass = stripslashes($pass); $user = mysql_real_escape_string($user); $pass = mysql_real_escape_string($pass); $pass = md5($pass); $mail=$_POST['email']; $sql = "INSERT INTO `cosmos`.`members` (`id`, `username`, `password`, `email id`) VALUES (NULL, \'$user\', \'$pass\', \'$mail\'), (NULL, \'\', \'\', \'\');"; $result=mysql_query($sql); echo "Pass!"; //dont know how to verify :) ob_end_flush(); ?>\[/code\]can you please correct this or give a new one , thanks in advance!
 
Back
Top