Ok, first of all: this is a part of sc I don’t have much experience. I need a report with a few sections containing blocks of data from different tables. There’s no master-detail, so I thought I could add a custom field and apply some html to it. If I enter it by hand it goes well so I tried to do so from the database:
// selecteer alle intakes
$check_sql = "SELECT m.intakeseq, m.intakedate, m.intaketype, m.intakecomm, i.intakeoms ".
" FROM MedicalIntake m, intakesoort i where m.DOHMPersnr = [glob_dohmpersnr]".
" AND m.intaketype = i.intakesoort";
sc_lookup(rs, $check_sql);
$i=0;
$r = "<br><table>";
while (isset({rs[$i][0]})) // Row found
{
$r.= "<tr>";
$intakeid = {rs[$i][0]};
$intakedate = {rs[$i][1]};
$intaketype = {rs[$i][2]};
$intakecomm = {rs[$i][3]};
$intaketypeoms = {rs[$i][4]};
$r.='<td>'.$intakeid.'</td>';
$r.='<td>'.$intakedate.'</td>';
$r.='<td>'.$intaketype.'</td>';
$r.='<td>'.$intakecomm.'</td>';
$r.='<td>'.$intaketypeoms.'</td>';
$r.="</tr>";
$i++;
}
$r .= '</table>';
{test}='dossier<br>'.$r;
The sql statement is correct and generates the needed data. However I get the following error messages when I run the app:
Fout
Undefined variable: intakedate
Fout
Undefined variable: intaketype
Fout
Undefined variable: intakecomm
Now I’m doing something obvious wrong, but I cannot see it. Anybody?