Hello ppl... i want to create a page which shows top 10 people on the basis of number of buds they have... Like one person have 20 buds, other have 35 and other have 50 buds, then the one with 50 buds shoud be on the top, then the one with 35 buds, then the one with 20 buds... I am using lavalair script.. what would be the SQL query for the same?? (Remember its lavalair database) I tried like hell... but cant succeed..... Any help would be much appreciated.. thanx..
Sql Query Needed...
Started on the old forum in February 2008 · view the original in the archive · old links redirect here
I have already tried that..@Alesh Top posters, top chatters etc is easy.. But finding out people with most buddies is tricky... That buddies table is different... External image (may be gone)
put this code in index.php under $action=="viewuser"
$budnum = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid='".$who."' OR tid='".$who."') AND agreed='1'"));
mysql_query("ALTER TABLE ibwf_users ADD bud INT( 100 ) NOT NULL DEFAULT '".$budnum[0]."' AFTER posts");
then make $action=="topbuds" like $action=="topp" in lists.php using the code
$sql = "SELECT id, name, bud FROM ibwf_users ORDER BY posts DESC LIMIT $limit_start, $items_per_page";
then you yourself view all members profile once to work
mysql_query("ALTER TABLE ibwf_users ADD bud INT( 100 ) NOT NULL DEFAULT '".$budnum[0]."' AFTER posts")
for all members
guys whats the query to fetch random pics from gallery?
Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!
guys whats the query to fetch random pics from gallery?
$image = mysql_fetch_array(mysql_query("SELECT id, imageurl FROM gallery ORDER BY RAND() LIMIT 1"));
echo "<img src=\"$image[1]\" alt=\"$image[0]\"/>
";
bro the code is giving me error External image (may be gone) Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/index.php on line 4774
Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!
bro the code is giving me error External image (may be gone) Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/index.php on line 4774
post here your mysql table for gallery