When i try to retrieve the results from my sql query within' php it doesn't shows me it right.
My result:
Array ( [0] => 0533 [SUBSTRING(cardnumber, 5, 4)] => 0533 )
While i just try to get the result that is
0533
to be shown.
My php File:
<?php
$con=mysqli_connect("localhost","root","wickedphat", "bluecard");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT SUBSTRING(cardnumber, 5, 4) FROM users WHERE username='".($_SESSION['username'])."'");
while($row = mysqli_fetch_array($result))
{
print_r($row) . " " ;
}
mysqli_close($con);
?>
and in my html file ive put this, where it suppose to show the result.
<?php include_once '../../includes/number1.php' ?>