php mysql query | html table -


guys confused populated data in table not showing first record

enter image description here

html table:

<table class="table table-bordered table-condensed" align="center" bordercolor="#cccccc">                             <tr bgcolor="#009933">                             <td align="center" style="color:#fff;">name</td>                             <td align="center" style="color:#fff;">course</td>                             <td align="center" style="color:#fff;">grade</td>                             <td align="center" style="color:#fff;">remark</td>                             </tr>                             <?php                             while($result= mysql_fetch_array($query1)){                                 echo "<tr>";                                 echo "<td>".$result['stud_name']."</td>";                                 echo "<td class=\"text-center\">"."</td>";                                 echo "<td>".$result['grade']."</td>";                                 echo "<td>".$result['remark']."</td>";                             }                             ?> </table> 

and query:

$query1 = mysql_query("select * tb_grade instructor_id = '$inst_id' , term = '$term' , description = '$desc'"); 

but when test query using json shows records

{     "test": [{         "stud_name": "jeo de jesus",         "grade": "58",         "remark": "failed"     }, {         "stud_name": "juana gonzales",         "grade": "60",         "remark": "failed"     }, {         "stud_name": "wendy lizardo",         "grade": "81",         "remark": "passed"     }, {         "stud_name": "jeffrey oliveras",         "grade": "91",         "remark": "passed"     }, {         "stud_name": "mc jester salinas",         "grade": "83",         "remark": "passed"     }],     "success": 1 } 

i think not closing . try this.(not tested)

<table class="table table-bordered table-condensed" align="center" bordercolor="#cccccc">                         <tr bgcolor="#009933">                         <td align="center" style="color:#fff;">name</td>                         <td align="center" style="color:#fff;">course</td>                         <td align="center" style="color:#fff;">grade</td>                         <td align="center" style="color:#fff;">remark</td>                         </tr>                         <?php                         while($result= mysql_fetch_array($query1)){                             echo "<tr>";                             echo "<td>".$result['stud_name']."</td>";                             echo "<td class=\"text-center\">"."</td>";                             echo "<td>".$result['grade']."</td>";                             echo "<td>".$result['remark']."</td></tr>";                         }                         ?> 


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -