Ok Im trying to do a small modification to a query but no matter what I try it doenst work so id like some help. Im working on a modifcation for an open source forum system I work with
[code=php]
$sql = “SELECT t.ID, t.sticky, t.status, t.viewcount, t.postcount, t.oldboardid, ”
.” fp.subject, fp.authorid, fp.pollid,fp.body, LENGTH(fp.body) AS postlength, ”
.” fp.authorid as firstpostuserid, ”
.” ufp.displayname as firstpostusername, ”
.” ufp.displayformat as firstpostusernameformat, ”
.” fp.postdate AS firstpostdate, ”
.” lp.ID AS lastpostid, ”
.” lp.authorid AS lastpostuserid, ”
.” ulp.displayname as lastpostusername, ”
.” ulp.displayformat as lastpostusernameformat, ”
.” lp.postdate AS lastpostdate”
.” FROM “.TABLE_THREADS.” t, “.TABLE_USERS.” ufp, “.TABLE_USERS.” ulp, “.TABLE_POSTS.” fp, “.TABLE_POSTS.” lp ”
.” WHERE fp.ID = t.postidfirst ”
.” AND lp.ID = t.postidlast ”
.” AND ufp.ID = fp.authorid ”
.” AND ulp.ID = lp.authorid ”
.” AND t.boardid = $boardid ”
.” ORDER BY sticky DESC, lastpostdate DESC”
.” LIMIT “.intval($startrow).”, “.intval($configoptions[perpagethreads]);
Heres my problem
I would like to change this line
[code=php]
.” AND t.boardid = $boardid “
so that it will select it if t.boardid=$boardid [b]OR
[code=php]
.” AND t.boardid = $boardid ”
.” OR t.sticky= 2 ”
I get this error returned
[b]Got error 28 from table handler
thank you for any help you can offer