Gizzer Posted June 26, 2007 Share Posted June 26, 2007 Hes my site that I used my code on ... http://testgame.awardspace.co.uk/signup.php But it doesnt send the data to the database when I click register. heres my code. $pas = $_POST['password']; $pass = sha1($pas) $user = $_POST['username']; $email = $_POST['email']; $charname = $_POST['charactername']; $passcheck = $_POST['confirmpassword']; $emailcheck = $_POST['confirmemail']; $connection = mysql_connect("*****") or die("Couldn't connect to databse"); mysql_select_db("*****", $connection); mysql_query('Insert into ***** (username,password,email,gamename) values ("'.$user.'","'.$pass.'","'.$email.'","'.$charname.'")',$connection); if (mysql_affected_rows() == 1){ echo "<h1><u><b>You are registered, please feel free to login</font></u></b></h1>"; }else{ echo "<h1><u><b>Username or character name already exists please use a diffrent username or character name</font></u></b></h1>"; I cannot spot any problems with the code but I have only been coding for about 1 month. } } ?> Link to comment https://forums.phpfreaks.com/topic/57343-solved-problem-adding-data-to-my-database/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.