USS Phenix
08-04-2002, 04:47 PM
Please help me I have tried to convert the sytle drop down hack to suit my needs for a multirank hack I am creating... This is the last stage in the hack, but I am getting an MySQL error from the modified usercp.php file.
The error is this
Invalid SQL: SELECT rankcategories.cat_name, userfield.rank, COUNT(*) AS count FROM userfield LEFT JOIN rankcategories USING (rank) GROUP BY userfield.rank
mysql error: Unknown column 'rankcategories.rank' in 'on clause'
That is from this source code;
$allranks=$DB_site->query("SELECT rankcategories.cat_name, userfield.rank, COUNT(*) AS count FROM userfield LEFT JOIN rankcategories USING (rank) GROUP BY userfield.rank");
$dropdownbits='';
while ($thisrank=$DB_site->fetch_array($allranks)) {
if ($rankid==$thisrank[cat_id]) {
$ranksel='selected';
} else {
$ranksel='';
}
eval("\$dropdownbits .= \"".gettemplate('multirank_dropdownbit')."\";");
}
Please could you tell me what I have done wrong. Because this peice of code will finish off my multirank hack (which I will release here, because it has proper admin section, and so if far better than the current multirank hack which is avaible.)
Thank you
Phenix
The error is this
Invalid SQL: SELECT rankcategories.cat_name, userfield.rank, COUNT(*) AS count FROM userfield LEFT JOIN rankcategories USING (rank) GROUP BY userfield.rank
mysql error: Unknown column 'rankcategories.rank' in 'on clause'
That is from this source code;
$allranks=$DB_site->query("SELECT rankcategories.cat_name, userfield.rank, COUNT(*) AS count FROM userfield LEFT JOIN rankcategories USING (rank) GROUP BY userfield.rank");
$dropdownbits='';
while ($thisrank=$DB_site->fetch_array($allranks)) {
if ($rankid==$thisrank[cat_id]) {
$ranksel='selected';
} else {
$ranksel='';
}
eval("\$dropdownbits .= \"".gettemplate('multirank_dropdownbit')."\";");
}
Please could you tell me what I have done wrong. Because this peice of code will finish off my multirank hack (which I will release here, because it has proper admin section, and so if far better than the current multirank hack which is avaible.)
Thank you
Phenix