Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,501,749
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-29-24 04:57 PM
Guest: Register | Login

0 users currently in Computing | 2 guests

Main - Computing - MySQL help (PHP) New thread | New reply


darkwitch
Posted on 03-26-07 03:36 PM Link | Quote | ID: 19480


Paragoomba
Level: 20

Posts: 42/65
EXP: 41519
Next: 920

Since: 02-21-07
From: Puerto Rico

Last post: 6224 days
Last view: 6224 days
So I need to figure out how to select all users that are online in a forum, but I also need to know if they are reading a thread which is in the forum (it counts as being in the forum). So I try using something like:

$sql ="SELECT * FROM threads,users WHERE threads.forum ='$forum[id]' AND users.lasturl = 'forum/$forum[id]' OR users.lasturl = ????"

???? is the part I can't figure how to do, I could use "LIKE 'thread/idhere%'" but then it would be inside quotes and be treated as text (the %).

Any help would be apreciated

Acmlm
Posted on 03-26-07 10:10 PM Link | Quote | ID: 19550


Flurry
Level: 37

Posts: 161/251
EXP: 315117
Next: 23136

Since: 02-19-07
From: Mirabel, Québec, Canada

Last post: 6183 days
Last view: 1816 days




Flurry
#&postrank&
When I did it before, I just made forum/thread pages set a "lastforum" field, then it was really simple:

SELECT * from USERS where lastforum=$forum[id]

____________________

darkwitch
Posted on 03-27-07 12:45 AM Link | Quote | ID: 19649


Paragoomba
Level: 20

Posts: 43/65
EXP: 41519
Next: 920

Since: 02-21-07
From: Puerto Rico

Last post: 6224 days
Last view: 6224 days
Hm, well, it's a nice solution. Thanks for the information

Main - Computing - MySQL help (PHP) New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.019 seconds. (321KB of memory used)
MySQL - queries: 47, rows: 58/59, time: 0.015 seconds.