Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

statistics

Asked Modified Viewed 1,404 times
S
stoerti
S
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
asked
Junior Member

Subcat download statistics count.

I get this error.

Unknown column 'download_subcats' in 'field list'

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]openside("statistik"wink;
$result = dbquery("SELECT * FROM ".$db_prefix."download_subcats WHERE ".groupaccess('download_subcats_access'wink." ORDER BY subcat_title"wink;
$rows = dbrows($result);
if ($rows != 0) {
$counter = 0; $columns = 2;
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 0)) echo "";
$num = dbcount("(download_subcats)", "".$db_prefix."downloads", "download_subcats='".$data['download_subcat_id']."'"wink;

echo "<a href='".BASEDIR."downloads.php?cat_id=".$data['download_subcat_id']."'>".$data['subcat_title']."</a> <span class='small2'>($num)</span>";
echo "<br>" ;
$counter++;
}
echo "";
} else {
echo "<center><br>\n".$locale['430']."<br><br></center>\n";
}
closeside();[/syntaxhighlighter]
0 replies

2 posts

S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
answered
Veteran Member

Should this line:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]$num = dbcount("(download_subcats)", "".$db_prefix."downloads", "download_subcats='".$data['download_subcat_id']."'"wink;[/syntaxhighlighter]
- not be like this:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]$num = dbcount("(download_subcats)", "".$db_prefix."download_subcats", "download_subcats='".$data['download_subcat_id']."'"wink;[/syntaxhighlighter] ?

Or have the table _downloads the field download_subcats in it ?
0 replies
S
stoerti
S
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
answered
Junior Member

So it is thanks.

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false] $result = dbquery("SELECT * FROM ".$db_prefix."download_subcats WHERE ".groupaccess('download_cat_access'wink." ORDER BY subcat_title"wink;
$rows = dbrows($result);
if ($rows != 0) {
$counter = 0; $columns = 2;
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 0)) echo "";
$num = dbcount("(download_subcat)", "".$db_prefix."downloads", "download_subcat='".$data['id']."'"wink;



echo "<table border='1' width='100%' cellpadding='0' cellspacing='0'>
<tr><td width='50%'>".$data['subcat_title']."</td> <td width='100%'>($num)</td></tr></table>";
$counter++;
}
echo "";
} else {
echo "<center><br>\n".$locale['430']."<br><br></center>\n";
}
[/syntaxhighlighter]
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

S
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
S
S
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet