Jump to content

Select results from past 7 days


guestabc

Recommended Posts

I currently have the query shown below

$sSQL=	"SELECT * FROM Results WHERE sUsername='$sTipsterID' AND sWonLost='Won' OR sUsername='$sTipsterID' AND sWonLost='Placed' sDate1 between date_sub(curdate(),INTERVAL 7 DAY) and curdate(ORDER BY sDate1 DESC ;";

 

however i'm getting the following error message

Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Unknown<br/><b>Description:</b> Unknown' in E:\path\to\tipsterdetails.php:142 Stack trace: #0 E:\path\to\tipsterdetails.php(142): com->Execute('SELECT * FROM q...') #1 {main} thrown in E:\path\to\tipsterdetails.php on line 142

 

 

Link to comment
https://forums.phpfreaks.com/topic/136954-select-results-from-past-7-days/
Share on other sites

Try looking at your SQL query

SELECT * FROM Results 
WHERE (sUsername='$sTipsterID' 
    AND sWonLost='Won')
     OR (sUsername='$sTipsterID' 
   AND sWonLost='Placed')
   AND sDate1 between date_sub(curdate(),INTERVAL 7 DAY) and curdate()
ORDER BY sDate1 DESC

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.