Jump to content

[SOLVED] Selectand page results by the date (week)


guestabc

Recommended Posts

hi i currently have the query below

 

$sSQL=	"SELECT * FROM qryRes WHERE sUser='$sTipsID' AND sWonLost='Won' OR sUser='$sTipsID' AND sWonLost='Placed' ORDER BY sDate DESC ;";

 

this selects all the results from my database for that user. however I am starting to get to many results to show on one page. so i am trying to page the results by week. i have searched google for this but not really found anything i understand. any help would be appreciated

hi i am trying the tutorial link that you sent me however I am having a problem with the mysql_fetch_row() function as i'm using a MS Access database. is there an alternative function i can use? thanks

 

$sql = "SELECT COUNT(*) FROM Results ";   
$result = $adoConnection->Execute( $sql );   
$r = mysql_fetch_row($result);   
$numrows = $r[0];  

I have solved the problem above but i now get an error in my next query. Any ideas? thanks

 

the error:

Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft JET Database Engine<br/><b>Description:</b> Syntax error (missing operator) in query expression

 

my sql statement:

$sql = "SELECT * FROM Results WHERE sUser='$sTID' AND sWon='Won' OR sUser='$sTID' AND sWon='Placed' LIMIT $offset, $rowsperpage";

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.