Link to home
Start Free TrialLog in
Avatar of firekiller15
firekiller15

asked on

Why can only output 5 element of the array

PHP
I have a list of student description as follow
input: array(ASIAN,EUPROPIAN,MIDDLE_EAST)
 
This is my table

Studentid        studentdescription
1                  ASIAN
2                  EUPROPIAN
3                  ASIAN
4                  EUPROPIAN
5                  ASIAN
6                  ASIAN  
7                  MIDDLE_EAST



foreach ($this->mapstudent as $student)
      {
  $query = "SELECT STUDENTID
             FROM STUDENT
             WHERE studentDescription = \"$student\"";

$result = mysql_query($query);
   
 $i = 0;
 while($row = mysql_fetch_array($result))
  {
      $this->splitstudentReturn[$i] = $row['studentID']; //get universeid and insert to GETCOMPNUM
   $i++;
  }
}

 print_r($this->splitstudentReturn)


i should get output = 1356247
but i only able got 5 element from array as show below

output      
Array ( [0] => 7 [1] => 4 [2] => 2 [3] => 6 [4] => 5 )

some more as you can see the result is reverse it start from
74265 --> why like that

why only five element show from array suppose should be 7 element
Avatar of firekiller15
firekiller15

ASKER

if i use echo $row['studentID'];  i can get result of 1356247
ASKER CERTIFIED SOLUTION
Avatar of shanikawm
shanikawm
Flag of Sri Lanka image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial