I am using PHP 7 and am trying to find a solution on how my code should be because of 3 functions I am using that have been depricated in current version of php 7.
The three functions are:
mysql_close() mysql_query() mysql_select_db()
Here is my code:
<?php
//mysql database connectivity
//inserting form data into the database
if(@$valid==true)
{
$con= mysqli_connect("localhost","root","root");
mysql_select_db("usersignup", $con);
@$a=$_POST['fname'];
@$b=$_POST['lname'];
@$c=$_POST['email'];
@$d=$_POST['cell'];
@$e=$_POST['add'];
@$f=$_POST['age'];
@$g=$_POST['gen'];
@$i=$_POST['username'];
@$j=$_POST['pass'];
@$h=$_POST['mtype'];
mysql_query("insert into user (FirstName,LastName,Email,CPhone,Address,Age,Gender,Username,Password,MType) values('$a','$b','$c','$d','$e','$f','$g','$i','$j','$h')");
header("Location:form1.php");
mysql_close($con);
}
?>
I have looked at some solutions offered that suggest the MySQLi or PDO_MySQL extension should be used, The problem is I havent found a practical way to impliment that.