query($sql); // check for error page if ($result->size() == 0) { $page = 'error.html'; $sql="SELECT fullname,description,keywords,h1,h2,copy 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']; $rimage = $row['rimage']; $vcard = $row['vcard']; } ?> "> <?php echo "$title" ?>
\n"; $psql="select type,image,jobnumber,`secondary` from (select `primary` as type,image,jobnumber,`secondary` from imagedb where gallery = 'yes' order by RAND()) as subquery group by type"; $presult=$db->query($psql); while ( $prow=$presult->fetch() ) { $pname = $prow['type']; $secondary = $prow['secondary']; $pcname = $prow['image']; $pjobn = $prow['jobnumber']; $dir = "../imageassets/project-top/ch-level/$pjobn/$pcname"; $p = str_replace(' ', '%20', $pname); //echo $p; if ($secondary == "No secondary") { $slink = "sectiona/".$p.".html"; } else { $slink = "section/".$p.".html"; } $rowcnt++; if(($rowcnt)%4==1) { $xtra .="
$pname
\n"; } else { $xtra .="
$pname
\n"; } if(($rowcnt)%4==0) $xtra .="
\n"; } $xtra .="
\n"; echo $xtra; ?>