I'm having a bit of a problem: I've loaded my database with data, and I'm trying to run a query to display all data that matches the criteria that I input, but all I get is a blank page. Can anyone help?
Here's the code:
pull.php:
<HTML>
<HEAD>
<BODY>
<?php
if (isset($HTTP_POST_VARS['xadd']))
{
// Set Mysql Variables
$host='localhost';
$user='xxxxxx';
$pass='xxxxxx';
$db='xxxxxx';
$table='xxxxxx';
$mon=$POST['mon'];
$day=$POST['day'];
mysql_connect($host, $user, $pass) or die('Connection died!');
mysql_select_db($db) or die('Selection died!');
$get_all = "SELECT * FROM $table WHERE month='$mon' AND day='$day'";
$myquery = mysql_query($get_all);
while ($row = mysql_fetch_array($myquery)) {
echo $row['one'];?><BR><?php
echo $row['year'];?><BR><?php
echo $row['month'];?><BR><?php
echo $row['day'];?><BR><?php
echo $row['event'];?><BR><BR><?php
}
}
else
{
include 'xpull.inc.php';
}
?>
</BODY>
</HTML>
xpull.inc.php:
<HTML>
<HEAD>
<BODY>
Input the values you wish to search by:
<FORM METHOD="post" ACTION="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>">
Month: <INPUT TYPE="text" NAME="mon" ID="mon"><BR><BR>
Day: <INPUT TYPE="text" NAME="day" ID="day"><BR><BR>
<INPUT TYPE="submit" VALUE="Search" NAME="xadd" ID="xadd">
</FORM>
</BODY>
</HTML>
The page displays the form and seems to accept the input, but then just gives a blank page.