$mysql = mysql_connect( 'localhost', 'thephoenixuk', 'hollyhocks' );
if(!$mysql)
{
echo 'Cannot connect to database.';
exit;
}
// select the appropriate database
$mysql = mysql_select_db( 'thephoenixuk' );
if(!$mysql)
{
echo 'Cannot select Database.';
exit;
}
// query the database to see if there is a record which matches
$query = "select count(*) from bannerinfo";
$result = mysql_query( $query );
if(!$result)
{
echo 'Cannot run query.';
exit;
}
$count = mysql_result( $result, 0, 0 );
if ( $count > 0 )
{
// visitor's name and password combination are correct
// echo "REPORTS
";
$query = 'select * from bannerinfo';
$result = mysql_query($query);
$numres = mysql_num_rows($result);
for ($j=0; $j<$numres; $j++)
{
$inp = mysql_fetch_array($result);
$data = $inp["banner"];
}
}
// data now obtained from database and lives in $data
?>
The Phoenix Badminton Club
Market Drayton

