advancedfuture Posted January 4, 2008 Share Posted January 4, 2008 This is the code from my simple PHP form. <? $username = $_POST['username']; $password = $_POST['password']; include 'dbConnect.php'; $sql = "SELECT * FROM users WHERE username = '$username'"; $results = mysql_query($sql); $num=mysql_num_rows($results); if($num > 0) { echo "Sorry Username is Already Taken!"; } else { $insert = "INSERT INTO users (username, password, video_url) VALUES ('$username', '$password', ' ')"; mysql_query($insert); echo "Registration Successful"; } ?> and this is the output i get when i try to register my username and password 0) { echo "Sorry Username is Already Taken!"; } else { $insert = "INSERT INTO users (username, password, video_url) VALUES ('$username', '$password', '')"; mysql_query($insert); echo "Registration Successful"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/84557-solved-problem-with-my-registration-form/ Share on other sites More sharing options...
advancedfuture Posted January 4, 2008 Author Share Posted January 4, 2008 omg i feel so stupid why do i not notice the solution until after i post.... i opened with <? instead of <?php LOL Quote Link to comment https://forums.phpfreaks.com/topic/84557-solved-problem-with-my-registration-form/#findComment-430829 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.