How to Make a Social Network from Scratch: Part 7 - Making the Register form work (remake)

howCode · 54K views · 2013 · 9:10

Open on YouTube

Web developmentDatabases & storagetutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they were following when their PHP registration form fails to save users or check for existing usernames.

Recommended by 0 people across 0 different months, 2014 to 2016.

What it is

Part 7 of howCode's 'Social Network from Scratch' series, a short screencast that wires up a registration form using PHP and MySQL. It is a remake of an earlier episode, with source code linked in the description.

What people said

Cites Luminusss · 2014-03 · Stack Overflow · on “Users not registering in phpmyadmin localhost DB”

I am following this tutorial [this video] and everything seems to be going fine (for the most part), but whenever a user is created, it redirects to the welcome page showing as if everything happened correctly, but then I check my phpmyadmin DB and there is nothing recorded... I have this as my connect line to access the DB: $link = mysqli_connect('localhost','root','password', 'social'); and then once the user has entered all information and hits submit this action should take place? $query = mysqli_query($link, "INSERT INTO users VALUES ('','$un','$fn','$ln','$em','$pswd','$pswd2','$d','0')"); die("<h2>Welcome to SOCiAL</h2>Login to your account to get started...."); where social is the name of

Cites Brian Yun · 2016-02 · Stack Overflow · on “Website does not properly check for existing username into the database or store data”

I am a beginner who stumbled upon this social media website making video and started working on it. ( [this video] ) there seemed to be lots of errors and people commented solutions and I tried fixing myself going back and fourth and most things worked. Now I'm mainly having trouble making the website to check for existing username on the server because even though there is nothing in the mysql database, it still displays 'username taken' when i fill in the form and submit it. and of course nothing is saved into the database. It'd be greatly appreciated if you guys could help me code used(copy and paste) to create table on phpmyadmin- CREATE TABLE IF NOT EXISTS users ( id int(11) NOT NULL AUTO_IN

Cites adam hope · 2016-05 · Stack Overflow · on “I keep getting an error message of i use an else function in PHP”

Here is the PHP block i am using: $reg = @$_POST['reg']; $fn = ""; $ln = ""; $un = ""; $em = ""; $em2 = ""; $pswd = ""; $pswd2 = ""; $d = ""; $u_check = ""; $fn = strip_tags(@$_POST['fname']); $ln = strip_tags(@$_POST['lname']); $un = strip_tags(@$_POST['username']); $em = strip_tags(@$_POST['email']); $em2 = strip_tags(@$_POST['email2']); $pswd = strip_tags(@$_POST['password']); $pswd2 = strip_tags(@$_POST['password2']); $d = date("Y-m-d"); //Year - Month - Day if ($reg) {} if ($em==$em2){} $u_check = mysql_query("SELECT username FROM users WHERE username='$un'"); $check = mysql_num_rows ($u_check); if ($check == 0){} if ($fn&&$ln&&$un&&$em&&$em2&&$pswd&&$pswd2){} if ($pswd==$pswd2){} if (s