Media copy

<form method = “post” action = “mediaquery.php”>
<?php

// Connect to MySQL
if ( !( $database = mysql_connect( “feijoa14.accountsupportmysql.com”, “webscript”, “apollo” ) ) )                die( “Could not connect to the database” );

// open NZFGA database
if ( !mysql_select_db( “feijoadata”, $database ) )
die( “Could not open NZFGA database” );

// Title search input
?>

<h2>Title</h2>
<p>Enter a word or phrase for which you wish to search, within the article heading: <br />
<textarea name = “title”  rows = “3” cols = “30” align = “left” ></textarea></p>

<?php

// query Products database for magasine
$query = “SELECT DISTINCT T_Media.F_Magasine FROM T_Media  ORDER BY T_Media.F_Magasine”;

if ( !( $result = mysql_query( $query, $database ) ) )
{
print( “Could not execute magasine   query <br>” );
die( mysql_error() );
}

print( “<h2>Magasine</h2>” );
print( “<p>Select a  magasine to search through: <br />” );

print( “<select name = \”magasine\”>” );
print( “<option selected>Search All</option>” );

// fetch each record in result set
for ( $counter = 0;
$row = mysql_fetch_row( $result );
$counter++ ){
foreach ( $row as $key => $value )
$NextID = $value + 1;
print( “<option>$value</option>” );
}
print( “</select> </p>” );

// Date range input
?>
<h2>Search Time Period</h2>
<p>Over what time do you want to search: <br />
<input type=”radio” name=”qdate” value=”lweek” >Last Week<br>
<input type=”radio” name=”qdate” value=”lmonth”>Last Month<br>
<input type=”radio” name=”qdate” value=”lyear”>Last Year<br>
<input type=”radio” name=”qdate” value=”lever” checked>Any Time </p>

<p></p>
<input type = “submit” value = “Find Articles”
style = “background-color: blue;
color: yellow; font-weight: bold” />
</form>