I have not visited PHP/MYSQLI for some time now, and, need some guidance on the following problem:
I'm trying to retrive all the data from the given week and just in that week. My table looks like the following:
id int(11)
type varchar(255)
week datetime
And as a test data I have the following:
1 Sport 2013-05-28 00:00:00
This is within this week, and, therefore should be returned, however, it does not return. Again, I am just getting back into PHP/MYSQLI so there may be a problem with my query, I just cannot seem to figure it out. Here is it below:
<?php
$mysqli = new mysqli("localhost", "root", "root", "Site");
if($mysqli->connect_errorno) {
die("Cannot connect to the database");
}
$getWeeks = "SELECT * FROM FlipCards WHERE week => currdate - INTERVAL DAYOFWEEK(currdate())+6 DAY
AND date < currdate() - INTERVAL DAYOFWEEK(currdate())-1 DAY";
$result = mysqli_query($getWeeks);
if(mysqli_affected_rows($result, $mysqli) >= 1)
{
echo 'There has been a row matched!'
}
?>
Could anyone please suggest where I am going wrong? I believe it has something to do with the query.