" . mysqli_connect_error(); return; } mysqli_query($connection,"SET NAMES utf8"); $query = "SELECT * FROM dogs WHERE dog_id='$dogid'"; if (($res = mysqli_query($connection,$query)) == FALSE) { print "Database query failed."; } else if (($num_rows = mysqli_num_rows($res)) == 0) { print "No records in the database."; } ?>

"; //print $num_rows; // process a single hound $row = mysqli_fetch_array($res,MYSQLI_BOTH); print "

\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
\n"; print " \n"; print "
\n"; print " \n"; print " Adopt Me\n"; print "
\n"; print "
\n"; print "

\n"; print " \n"; print " {$row['dog_name']}
\n"; print "
\n"; print "

\n"; if ($row['dog_born'] != "") print " Born: {$row['dog_born']}
\n"; if ($row['dog_race_name'] != "") print " Race name: {$row['dog_race_name']}
\n"; if ($row['dog_color'] != "") print " Color: {$row['dog_color']}
\n"; if ($row['dog_gender'] != "") print " Gender: {$row['dog_gender']}
\n"; if ($row['dog_housing'] != "") print " Housing: {$row['dog_housing']}
\n"; if ($row['dog_cats'] != "") print " Cats: {$row['dog_cats']}
\n"; if ($row['dog_sml_dogs'] != "") print " Small Dogs: {$row['dog_sml_dogs']}
\n"; if ($row['dog_weight'] != "") print " Weight: {$row['dog_weight']}
\n"; if ($row['dog_status'] != "") { print " \n"; print " Status: {$row['dog_status']}
\n"; print "
\n"; } if ($row['dog_text'] != "") { $clean = stripslashes($row['dog_text']); print " {$clean}\n"; } print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "\n"; print " \n"; $cnt = 0; if (is_dir("./gallery/{$row['dog_id']}")) { $thumbs = scandir("./gallery/{$row['dog_id']}"); // print_r($thumbs); foreach ($thumbs as $pic) { if ($pic == "." || $pic == "..") continue; if (preg_match('/image/',$pic)) continue; if ($cnt == 4) { print " \n"; print " \n"; $cnt = 0; } print " \n"; $cnt++; } } print " \n"; print "
\n"; $imgpic = preg_replace('/thumb/','image',$pic); $base = substr($imgpic,0,-4); print "\n"; if ($cnt < 3) { print " \n"; } print "
\n"; print "
\n"; ?>