Game List
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Total GameList row count
$query2 = "SELECT COUNT(*) FROM GameList";
$result2 = $con->prepare($query2);
$result2->execute();
$row_count = $result2->fetchColumn();
printf ("Total Games in this list: %d\n ",$row_count);
// GameList table creation
$query = "SELECT * FROM GameList order by GameTitle asc";
// First pass - Get the column names (headers)
print "";
$result = $con->query($query);
//return only the first row (we only need field names)
$row = $result->fetch(PDO::FETCH_ASSOC);
print "
";
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
} // end try
?>
$field | "; } // end foreach print "
---|
$value | "; } // end field loop print "