Hi,
I am getting a ‘Fatal error: Call to a member function numRows() on a non-object in …/…/logaway.php on line 75’
I just have no idea what this means and each post on the internet says different things…
Lines 61 onwards of my code:
[php] <?php
$sentdate = $_POST[‘date’];
$sentshift = $_POST[‘shift’];
$con = mysql_connect(“localhost”,“db1a”,“user1”);
if (!$con)
{
die('Could not connect: ’ . mysql_error());
}
mysql_select_db(“db1”, $con);
echo $sentdate;
echo $sentshift;
$sql = ‘SELECT date, shift FROM invalid_dates
WHERE date = “$sentdate” AND shift = "$sentshift’;
$result = mysql_query($sql); [/php]
This is line 75:
[php]if ($result->numRows () == 0)[/php]
[php]{
echo ‘This date is available to book a deputy to cover for you. Please click to continue’;
}
else ‘Sorry this date is unavailable. If you wish to persue this further, please talk to the staff.’;
$checknotes = ‘SELECT notes from invalid_dates
WHERE date = “$sentdate” AND shift = "$sentshift’;
echo $checknotes;
mysql_close($con);
ob_end_flush(); ?>
[/php]
Thanks for any advice,
jake66