I'm a beginner in php. Starting my learning at php 7 and not 5 or earlier.

I don't understand why php 7 is acting weird. It give different result at different time. Do you guy mind checking if I got the coding wrong or if I've come across a php 7 bug ?

It is a basic member registration &amp; login script.

How It Works:

1. When you register (username, password, email), it dumps the data onto a MySQL table "pending_users" and inserts "0" on "account activation" row. It will replace the "0" with "1" after you click the account activation link that gets emailed to you.

2. When you click the account activation link, your email gets verified and a new table in mysql gets created under your username. That table will contain data of your account activities.

Script replaces the "0" (table: pending_users, row: account activation) with "1" after you click the account activation link that gets emailed to you. If you click the link anytime, anyday after that then you get alerted a message asking you why you trying to activate an account you already activated.

That's about it.

Pages: register.php AND account_activation.php.

The problems are in the account_activation.php. When you click the account activation link in your email then that page takes over. So far, so good. Now, notice that after you get the message that your account has been activated, you do not get redirected to home.php like the script says. Redirection failing in php 7.

PROBLEM 2: You will see you get errors not on the error file but on the activation_account.php page. The error:

<pre>You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'varchar(30) NOT NULL, Email varchar(50) NOT NULL, Forename varchar(30)' at line 3</pre>

OTHER ISSUE:

I am trying to learn php starting from php 7. Getting these codes watching youtube php channels. I update as much as I can to customize according to my needs. I fear the code may contain php 5 syntax and so if you spot any then kindly show me a php 7 syntax example and get a thumbs-up from here.

PS - Why don't you guys open a php 7 tutorial channel and teach how to build Social Network like facebook, twitter and youtube etc. ? There are channels in youtube that teach these but they don't regularly upload videos and and I hate the waiting.