hi to all Tip master's,
Newbie here!
I have table and i want to print the record in series..
does anyone inform me what's wrong w/ my code...
<?php
$sql="SELECT stud_no, lastname, firstname, m_i, yr, cc, count(*) FROM stud_info group by stud_no, lastname, firstname, m_i, yr, cc order by lastname";
$b=pg_exec($con,$sql);
$graderow["no"] = 1;
while($graderow=pg_fetch_array($b)){
echo"row"> $graderow["row"];
print"<tr>";
$graderow["no"] = $graderow["row"] +1;
print"<td>{$graderow["no"]}</td>";
print"<td>{$graderow["stud_no"]}</td>";
print"<td>{$graderow["lastname"]}</td>";
print"<td>{$graderow["firstname"]}</td>";
print"<td>{$graderow["m_i"]}</td>";
print"<td>{$graderow["yr"]}</td>";
print"<td>{$graderow["cc"]}</td>";
print"</tr>";
}
Output
No Stud_no Lastname Firstname MI Year Course
1 04-0009 Acosta Jong C I IT
1 04-0014 Almanza Rommel M. I IT
1 03-0001 Alvarez Armi S II SE
1 04-0008 Basco Edsel A I SE
should be
No Stud_no Lastname Firstname MI Year Course
1 04-0009 Acosta Jong C I IT
2 04-0014 Almanza Rommel M. I IT
3 03-0001 Alvarez Armi S II SE
4 04-0008 Basco Edsel A I SE
thanks,
omr c",)
Newbie here!
I have table and i want to print the record in series..
does anyone inform me what's wrong w/ my code...
<?php
$sql="SELECT stud_no, lastname, firstname, m_i, yr, cc, count(*) FROM stud_info group by stud_no, lastname, firstname, m_i, yr, cc order by lastname";
$b=pg_exec($con,$sql);
$graderow["no"] = 1;
while($graderow=pg_fetch_array($b)){
echo"row"> $graderow["row"];
print"<tr>";
$graderow["no"] = $graderow["row"] +1;
print"<td>{$graderow["no"]}</td>";
print"<td>{$graderow["stud_no"]}</td>";
print"<td>{$graderow["lastname"]}</td>";
print"<td>{$graderow["firstname"]}</td>";
print"<td>{$graderow["m_i"]}</td>";
print"<td>{$graderow["yr"]}</td>";
print"<td>{$graderow["cc"]}</td>";
print"</tr>";
}
Output
No Stud_no Lastname Firstname MI Year Course
1 04-0009 Acosta Jong C I IT
1 04-0014 Almanza Rommel M. I IT
1 03-0001 Alvarez Armi S II SE
1 04-0008 Basco Edsel A I SE
should be
No Stud_no Lastname Firstname MI Year Course
1 04-0009 Acosta Jong C I IT
2 04-0014 Almanza Rommel M. I IT
3 03-0001 Alvarez Armi S II SE
4 04-0008 Basco Edsel A I SE
thanks,
omr c",)