I have included most of the code from the beginning.
<?php
try
{
{
/*** mysql hostname ***/
$hostname = 'xxxxxxxxxxxxxxxxxxxxx';
/*** mysql username ***/
$username = 'xxxxxxxxxx';
/*** mysql password ***/
$password = 'xxxxxxxxx';
$dbname = 'xxxxxx';
$dhb = null;
$dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
$dbh->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true );
/** echo a message saying we have connected **/
/**echo "connected"; **/
}
}
catch(PDOException $e)
{
echo $e->getMessage();
}
?>
<div class="content">
<?php include('header.php');?>
<?php include('menu1.php');?>
<br />
<div>
<center><table cellspacing="5" cellpadding="5" width="800" border="0">
<tr>
<td height="57" colspan="3" width="800">
<hr />
<div style="text-align: center;">Multiuse Pictures 2014</div>
<div style="text-align: center;">Click picture to enlarge.</div>
<hr />
</td>
</tr>
<?php
try
{
$type = $_GET['type'];
//-query the database table
if($_GET['type'] == 'ak')
{
//*$sql = "SELECT * FROM jewelry WHERE class = '$type' ";**/
$sql = "SELECT id, cid, group, image_th, image, picture, comment FROM images WHERE group = 'dionne' ORDER BY cid ASC";
}
else if($_GET['type'] == 'dionne')
{
$sql = "SELECT * FROM images WHERE picture = '2'";
}
$result = $dbh->query($sql);
$rows2 = '0';
$rows3 = '0';
if($result)
{
$i = 0;
$max_columns = 3;
foreach ($result as $row)
{
// open row if counter is zero
if($i == 0)
{
echo "<tr VALIGN='top'>";
}
// if ($row['avail'] != "0")
//{
// make sure we have a valid product ALIGN='CENTER'
if($row['image_th'] != "" && $row['image_th'] != null)
{