Skip to main content
added 618 characters in body
Source Link
MaMba
  • 101
  • 2

using

while( $row = $query->fetch_assoc() ) {

 statement relating $row 

}

The loop Will Escape the first OR the Zeroth Index in the Query as While loop loops till the End of the Array is reached the $row is assigned automatically the first value and is per-incremented so you wont help Array(first_query);

if you want it to retrieve values from your db use a array such that

$a2=array();
    $a2[0]=mysqli_fetch_assoc($my_sql_query);   //fetches the first missing value
    while( $row = $query->fetch_assoc() ) {
     statement relating $row 
    $a2[]=$row;
}
echo json_decode($a2);
while( $row = $query->fetch_assoc() ) {
    statement relating $row

using

while( $row = $query->fetch_assoc() ) {

 statement relating $row 

}

The loop Will Escape the first OR the Zeroth Index in the Query as While loop loops till the End of the Array is reached the $row is assigned automatically the first value and is per-incremented so you wont help Array(first_query);

if you want it to retrieve values from your db use a array such that

$a2=array();
    $a2[0]=mysqli_fetch_assoc($my_sql_query);   //fetches the first missing value
    while( $row = $query->fetch_assoc() ) {
     statement relating $row 
    $a2[]=$row;
}
echo json_decode($a2);
added 11 characters in body
Source Link
TheCoffeeCup
  • 9.4k
  • 4
  • 36
  • 96

while( $row = $query->fetch_assoc() ) { statement relating $row

while( $row = $query->fetch_assoc() ) {
    statement relating $row

while( $row = $query->fetch_assoc() ) { statement relating $row

while( $row = $query->fetch_assoc() ) {
    statement relating $row
Source Link
MaMba
  • 101
  • 2

while( $row = $query->fetch_assoc() ) { statement relating $row