Hi, I'm trying to work my wy around the fact that you don't have support for nested select in MySQL. I have tried with variables but can't get it to work for me. What am I doing wrong?
<?php
include("mydb.inc");
$mydb=new db;
$mydb->connect();
$mydb->connect_db();
$sql1="select max(PersonID) from Person";
$mydb->query($sql1);
$no=mysql_num_rows($mydb->qid);
$row=$mydb->fetcharray();
do{
$row=$mydb->fetcharray();
printf("<TR><TD>%s</TD>", $row["PersonID"]);
$i++;
}
while($i<$no);
$sql="select * from Person where PersonID = $sql1" ;
$mydb->query($sql);
$no=mysql_num_rows($mydb->qid);
$row=$mydb->fetcharray();
printf("<TD>%s </TD>", $row["FirstName"]);
printf("<TD>%s </TD>", $row["LastNAme"]);
$mydb->close();
?>
Grateful for any help.
Mitz.
<?php
include("mydb.inc");
$mydb=new db;
$mydb->connect();
$mydb->connect_db();
$sql1="select max(PersonID) from Person";
$mydb->query($sql1);
$no=mysql_num_rows($mydb->qid);
$row=$mydb->fetcharray();
do{
$row=$mydb->fetcharray();
printf("<TR><TD>%s</TD>", $row["PersonID"]);
$i++;
}
while($i<$no);
$sql="select * from Person where PersonID = $sql1" ;
$mydb->query($sql);
$no=mysql_num_rows($mydb->qid);
$row=$mydb->fetcharray();
printf("<TD>%s </TD>", $row["FirstName"]);
printf("<TD>%s </TD>", $row["LastNAme"]);
$mydb->close();
?>
Grateful for any help.
Mitz.