query($sql); // check for error page if ($result->size() == 0) { $page = 'error.html'; $sql="SELECT fullname,description,keywords,h1,h2,copy,copy2 FROM jcamaintab where url = '$page'"; $result=$db->query($sql); } while ( $row=$result->fetch() ) { // Place row data in indexed array $title = $row['fullname']; $description = $row['description']; $keywords = $row['keywords']; $h1 = $row['h1']; $h2 = $row['h2']; $copy = $row['copy']; $copy2 = $row['copy2']; } ?> "> JOHNSTON CAVE ASSOCIATES - <?php echo "$title" ?>
\n"; $psql = "SELECT title,url,header1,projectid from jcaprojectdetail where active = 'yes' and `delete` = 'no' and frontpage = 'yes' ORDER BY RAND() limit 4"; $presult=$db->query($psql); while ( $prow=$presult->fetch() ) { $ptitle = $prow['title']; $purl = $prow['url']; $phead = $prow['header1']; $projid = $prow['projectid']; $psql2="select type,image from (select `primary` as type,image from imagedb where active = 'yes' and jobnumber = '$projid' order by RAND()) as subquery group by type"; $presult2=$db->query($psql2); while ( $prow2=$presult2->fetch() ) { $pcname = $prow2['image']; $dir = "../imageassets/project-top/ch-level/$projid/$pcname"; }; $xtra .="
Johnston Cave Associates Architects - link to $projid"; $xtra .="
\n"; } $xtra .="
\n"; echo $xtra; ?>