Hello I am having difficult on what looks like a straight forward problem...
I have a database which has a table of days, dates and whether they are working days or weekends. What I want to do is to echo / print the number of working days between two dates. The sql is fine when I query it in phpmyadmin but when I go to echo the result it comes back with an error message -
"Catchable fatal error: Object of class mysqli_result could not be converted to string in"
This is the php code I am using. Any helpful ideas would be most appreciated.
$sql = ("SELECT COUNT( 'Day' ) FROM impcalc2 WHERE 'Date' BETWEEN '2011-08-10' AND '2011-08-20' AND 'Workday' = 'workingday'");
$result = mysqli_query($conn, $sql);
echo $result;
$result->free();
$conn->close();