why returning only first latter of each values from database during fetching using php?

i am trying to fetch the column data from database using PHP code but i don’t now why returning only first letter of each values as result,can you please guide me?
in finding what i am missing ?this is my PHP code below

$profile_change_sql=”SELECT `Username`, `Password`, `Email-id` FROM `patient_info` WHERE `id`='”.$id_of_user.”‘”;
$presult=mysqli_query($con,$profile_change_sql);
if($presult)
{
$row=mysqli_num_rows($presult);
if($row==1)
{

$array_result=mysqli_fetch_row($presult);
$lenght=count($array_result);
//print_r($array_result);
$arr=[];
//print_r($arr);
for($i=0; $i<$lenght; $i++)
{
for($j=$i; $j<=$i; $j++)
{
$arr[$j]=$array_result[$i];

}

}
print_r($arr);
foreach($arr as $values)
{
//stristr(,$values[0]);
echo $values[0];
}

}

Read more here:: why returning only first latter of each values from database during fetching using php?

Leave a Reply

Your email address will not be published. Required fields are marked *