First post in this website so bear with me. I'm also new to php coding. I've been banging my head against this code for a while now it seems so simple but yet it's giving me such problems and I'm not sure its my code at this point or something not setup correctly with the mysqli database itself. Here is the header and the code that I'm trying to create a downline builder with for my four corners site any suggestions would be helpful. <?php session_start();require ('./Checklogin.php');
$con=mysqli_connect("localhost","username","password","DB");
if(mysqli_connect_errno()){
echo "Failed to connect to the database" . mysqli_connect_error();
}
?>
<!DOCTYPE html>
<html>
<h2>Step 2 - Join from the link below:</h2>
<?php
$id = $_SESSION['$id'];
$sql = mysqli_query("SELECT 'refferalid' FROM Users WHERE id= '$id'");
$result = $con->query($sql);
$result_id = $result["refferalid"];
$fourcornerssql = mysqli_query("SELECT 'fourcorners' FROM Users WHERE id= '$result_id'");
$fourcorners = $con->query($fourcornerssql);
$fourcorners_id = $fourcorners["fourcorners"];
echo' link=$fourcorners_id .
$con->close();
?>
$con=mysqli_connect("localhost","username","password","DB");
if(mysqli_connect_errno()){
echo "Failed to connect to the database" . mysqli_connect_error();
}
?>
<!DOCTYPE html>
<html>
<h2>Step 2 - Join from the link below:</h2>
<?php
$id = $_SESSION['$id'];
$sql = mysqli_query("SELECT 'refferalid' FROM Users WHERE id= '$id'");
$result = $con->query($sql);
$result_id = $result["refferalid"];
$fourcornerssql = mysqli_query("SELECT 'fourcorners' FROM Users WHERE id= '$result_id'");
$fourcorners = $con->query($fourcornerssql);
$fourcorners_id = $fourcorners["fourcorners"];
echo' link=$fourcorners_id .
$con->close();
?>