Skip to content

Instantly share code, notes, and snippets.

@mskian
Created May 2, 2017 09:41
Show Gist options
  • Save mskian/98b102fd27d093ac113eb95799ad08fc to your computer and use it in GitHub Desktop.
Save mskian/98b102fd27d093ac113eb95799ad08fc to your computer and use it in GitHub Desktop.
<?php
//status.php?id=USER_ID
include('db.php');
if($_GET['id'])
{
//variables
$id=mysqli_real_escape_string($con,$_GET["id"]);
//selecr from database
$sql_query = "SELECT * FROM referral WHERE id='$id'";
$result_set=mysqli_query($con,$sql_query) or die('error');
$ref_row=mysqli_fetch_array($result_set); //fetch the result from table
$count=$ref_row['clicks'];
$user=$ref_row['user'];
}
?>
<?php
if($ref_row)
{
echo "<p>$user Refer $count Users</p>";
}
else
{
echo "<h1>404 Page boss</h1>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment