I am trying to build a query that will select values from one table, and compare them to values in another table to see if they exist or not. Here is my code thus far:
$startselect = mysql_query("SELECT userid, username FROM bb1_users ORDER BY userid ASC");
while ($select = mysql_fetch_array($startselect)) {
$userid = $select[userid];
$check = mysql_query("SELECT starterid, COUNT(starterid) AS count FROM bb1_threads WHERE starterid=$userid AND boardid IN (4, 6, 7, 9, 36, 37, 38, 40, 49, 60, 12, 13, 40, 41, 42, 58, 59, 64) GROUP BY starterid");
eval ("\$nopubscanbit .= \" ".$tpl->get("nopubscanbit")."\";");
}
eval("\$tpl->output(\"".$tpl->get("nopubscan")."\");");
This is going to be used for a bulletin board, thus the tpl output stuff. What I want it to be doing is taking the userid, and then, using the $check query, compare it to see if the user has started any threads in that forum (the boardid IN part). It then outputs a tpl file which prints the data all nice and pretty. Only problem is, I dunno if the queries are correctly nested/constructed because while it outputs 800+ tables, there are no values in them 🙁 So i know it gets to the first and second eval statements. Can anyone help me out with this one? Thanks! 🙂