Happy new year to everyone..
in my sql db there r 2 tables. mathimata and apousies
from table -apousies- i "select" some data (the amount of absences) for a particular person (student) for every class he attended.
i want for every class of the above result to search in table -mathimata- and to find the board_of_absences of that classes (the field orio_apousiwn)
code
...
$qry="SELECT semester, math, apousies FROM apousies WHERE member='$all' order by semester"; // i get semester, class and absences for a particular student
$result=mysql_query($qry);
if($result) {
while($grammh = mysql_fetch_array($result)) {
$result2=mysql_query(" Select distinct orio_apousiwn from mathimata where mathima='$grammh[math]' and semester='$grammh[semester]' ");
$orio =mysql_fetch_assoc($result2);
$or1=$orio[orio_apousiwn];
echo "Semester: $grammh[semester], class: $grammh[math], absences: $grammh[apousies], board_of_absences: $or1"."<BR>";}
exit(); }
The script is working. the data shows results except the first line of results that only board_of_absences ( orio_apousiwn) is empty
one result:
Semester:A, class: Γλώσσα, absences: 23, board_of_absences:
Semester:A, class: Φυσική, absences: 12, board_of_absences: 22
Semester:A, class: Χρήση Η/Υ, absences: 4, board_of_absences: 16
the 2 and 3 line are ok in 1 there is no value in board_of_absences: but it should be........
i can not understand why.....
can u help me?????