HOW TO: Loop a simple query with table output HOW TO: Loop a simple query with table output
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

HOW TO: Loop a simple query with table output

Started by sigepjedi, May 17, 2006, 05:48:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sigepjedi

im basically trying to create a page to show my top 10 commenting users with the following query:

Quote
$sql = cpg_db_query("SELECT count( * ) AS TOPCOMMENT, msg_author FROM `bw_comments` GROUP BY author_id ORDER BY TOPCOMMENT DESC LIMIT 10 ");

my query is good, but I cant seem to get it to loop and output correctly in html tables in coppermine.
I thought there would be something like this in the forums, but i couldnt locate any such "Top Commenter" code.

Thanks in Advance!!!

sigepjedi

Ok, found the topic.. still getting used to the new forums deep categories:

http://forum.coppermine-gallery.net/index.php?topic=8405.0

for this to work, just modify

Quotedb_query(

TO

Quotecpg_db_query(