Dealing with dates in mysql?

chris2266

New Member
EDIT: changed the whole question sorry, im trying to deal with the mysql DATETIME values,this is my mysql query:\[code\]$result="SELECT u.username, u.picture, m.id, m.user_note, m.reply_id, m.reply_name, m. m.dtFROM relationships r, notes m, user uWHERE m.user_id = r.leaderAND r.leader = u.user_idAND r.listener ='".$_SESSION['user_id']."'UNIONSELECT username, picture, id, user_note, reply_id, reply_name, dtFROM user u, notes bWHERE u.user_id = b.user_idAND b.user_id = '".$_SESSION['user_id']."'AND dt < '".$lastmsg."'ORDER BY dt DESCLIMIT 10 ";\[/code\]im trying to find rows from this query older than '$lastmsg' and not $lastmsg itself, i thought about using less than but not equal to operator! im not sure if that was stupid!!!P.S the query works, but its retriving wrong information!!
 
Back
Top