$conn = mysql_connect($host,$user,$pass);
if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
//Connection has succeeded!
if(mysql_select_db('bj_poems',$conn))
{
//Connection is totally successful
//Show tag cloud
echo '
';
$dateCloud = new wordCloud();
$categoryCloud = new wordCloud();
$formCloud = new wordCloud();
$SQL = "SELECT date, form, category FROM poems";
$retid = mysql_db_query('bj_poems',$SQL, $conn);
if (!$retid)
{
die( mysql_error());
}
else
{
/* fetch rows */
$NumberOfRows = mysql_num_rows($retid);
for ($i = 0; $i < $NumberOfRows; $i++)
{
if (!mysql_data_seek($retid, $i))
{
echo "Cannot seek to row $i: " . mysql_error() . "\n";
continue;
}
if (!($row = mysql_fetch_assoc($retid)))
{
continue;
}
$dateCloud->addWord($row['date']);
$categoryCloud->addWord($row['category']);
$formCloud->addWord($row['form']);
}
$myDateCloud = $dateCloud->showCloud('array');
$myFormCloud = $formCloud->showCloud('array');
$myCategoryCloud = $categoryCloud->showCloud('array');
echo 'Search by Year
'; if(is_array($myDateCloud)); { foreach($myDateCloud as $key => $value) { echo''.$value['word'].' '; } } echo '
Search by Forms
'; if(is_array($myFormCloud)); { foreach($myFormCloud as $key => $value) { echo''.$value['word'].' '; } } echo '
Search by Categories
'; if(is_array($myCategoryCloud)); { foreach($myCategoryCloud as $key => $value) { echo''.$value['word'].' '; } echo '
';
}
}
}
?>
'; if(is_array($myDateCloud)); { foreach($myDateCloud as $key => $value) { echo''.$value['word'].' '; } } echo '
Search by Forms
'; if(is_array($myFormCloud)); { foreach($myFormCloud as $key => $value) { echo''.$value['word'].' '; } } echo '
Search by Categories
'; if(is_array($myCategoryCloud)); { foreach($myCategoryCloud as $key => $value) { echo''.$value['word'].' '; } echo '
My Poetry
This section of the site contains access to a selection of my poems. I aim to make available a selection of poems covering several years. As far as possible I will select the best from each period for display. This page will be updated later with better search options.
This page provides a starting point to search for my poems. Enter a search term in the searchbox, either a year number, e.g. 2008, a title, a form or a category. Select the search type from the drop down box and press submit.