unidox Posted October 24, 2007 Share Posted October 24, 2007 I made a register form and here is the code: // Variables $name = $_POST['name']; $dname = $_POST['display_name']; $username = $_POST['username']; $password = $_POST['password']; $email = $_POST['email']; $age = $_POST['age']; $dob = $_POST['dob']; $country = $_POST['country']; $location = $_POST['location']; $website = $_POST['website']; $aim = $_POST['aim']; $msn = $_POST['msn']; $yim = $_POST['yim']; $icq = $_POST['icq']; $info = $_POST['info']; $games = $_POST['games']; $interests = $_POST['interests']; // Query $q = mysql_query("SELECT * FROM `pcp_users` WHERE username = '$username' || email = '$email'"); $r = mysql_fetch_array($q); if(($r['username'] == $username) || ($r['email'] == $email)) { header("Location: " . $site_url . "index.php?p=register&e=1"); } if(($name == "") || ($dname == "") || ($username == "") || ($password == "") || ($email == "")) { header("Location: " . $site_url . "index.php?p=register&e=2"); } mysql_query("INSERT INTO `pcp_users` (username,password,email,display,name,description,age,dob,country,location,interests,website,aim,msn,icq,yim,games) VALUES ('$username','$password','$email','$dname','$name','$info','$age','$dob','$country','$location','$interests','$website','$aim','$msn','$icq','$yim','$games')"); The problem is, when I try to register, nothing goes into the db. What am I doing wrong? Thanks Link to comment https://forums.phpfreaks.com/topic/74632-solved-insert-into/ Share on other sites More sharing options...
pocobueno1388 Posted October 24, 2007 Share Posted October 24, 2007 Put a die statement at the end of the query. mysql_query("INSERT INTO `pcp_users` (username,password,email,display,name,description,age,dob,country,location,interests,website,aim,msn,icq,yim,games) VALUES ('$username','$password','$email','$dname','$name','$info','$age','$dob','$country','$location','$interests','$website','$aim','$msn','$icq','$yim','$games')") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/74632-solved-insert-into/#findComment-377240 Share on other sites More sharing options...
unidox Posted October 24, 2007 Author Share Posted October 24, 2007 Thanks, I fixed it, I spelled a column wrong lol Link to comment https://forums.phpfreaks.com/topic/74632-solved-insert-into/#findComment-377247 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.