msql help

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   msql help
websolution
CZ Active Member
websolution has been a member for over 20 year's 20 Year Member
netherlands.gif
Occupation: security
Age: 47
Gender: Male
Website:
Status: Offline
Joined: Dec 28, 2003
0.01 posts per day
Posts: 111
Points: 2,993
   
hello all,

Question:

i want to ad a module to my top 10 listingpage.
Now i know i have to ad the index page of the TOP module.

But its all with Mysql id's and stuff and i realy dont know annything about adding mysql commands into the phpnuke pages.
is there a tutorial about this, or a standard page that i can alter? because i want to do this by myself icon_biggrin.gif (ill probably ask for help within 24 hours LOL)

I tried some things already but it doesnt show up in the index page icon_rolleyes.gif
I have putted the code below (dont laugh...i know its messed up icon_mrgreen.gif )

$sql = "SELECT memberid, sitename, url, counter FROM ".$prefix."_nuke_mstopsites ORDER BY counter DESC LIMIT 0,$top";
$result = $db->sql_query($sql);
if ($db->sql_numrows($result) > 0) {
    echo "<table border=\"0\" cellpadding=\"10\" width=\"100%\"><tr><td align=\"left\">\n"
   ."<font class=\"option\"><b>$top "._sitename."</b></font><br><br><font class=\"content\">\n";
    $lugar=1;
    while ($row = $db->sql_fetchrow($result)) {
$memberid = $row[memberid];   
$sitename = $row[sitename];
$url = $row[url];
   $counter = $row[counter];
   if($counter>0) {
       echo "<strong><big>·;</big></strong> ;;$lugar: <a href=\"modules.php?name=MS_TopSites&amp;memberid=memberid&amp;op=newindex&amp;memberid=$memberid\">$title</a> - ($counter "._sitename.")<br>\n";
       $lugar++;
   }
    }
    echo "</font></td></tr></table><br>\n";
}


If someone wants to help or gives me some tips, your welcome.

Greets

web-solution



_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#2   re: msql help
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   
Just copy the code from another module in the Top page and change it ever so slightly to reflect the new table your trying to query.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   
websolution
CZ Active Member
websolution has been a member for over 20 year's 20 Year Member
netherlands.gif
Occupation: security
Age: 47
Gender: Male
Website:
Status: Offline
Joined: Dec 28, 2003
0.01 posts per day
Posts: 111
Points: 2,993
   
Hi Telli,

Thats what is did with the code i provided above.
The thing i dont get is, all the different commands for the mysql database.
I tried to compare different kinds of mysql commands but its to confusing. eusa_wall.gif

I also tried it with 3 different kind of PHP editors with integrated mysgl commands (to manny diffrent ones icon_eek.gif ), but i dont know withs command does what.

Is there anny way that you can help me? PLEASE icon_razz.gif

THNX



Back to top Reply with quote
#4   re: msql help
Milkman
CZ Super Newbie
Milkman has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Dec 28, 2003
0.01 posts per day
Posts: 45
Points: 2,228
   
I might be wrong on this, but in all of my Mysql scripts, when i output stuff, i use single quotes like
echo "<td>".$meetingdate['month']." ".$meetingdate['mday'].", ".$meetingdate['year']."</td>";


But, what exactly is the problem? Is it not outputing any information, are you getting errors and what are they?


Back to top Reply with quote
#5   Re: re: msql help
websolution
CZ Active Member
websolution has been a member for over 20 year's 20 Year Member
netherlands.gif
Occupation: security
Age: 47
Gender: Male
Website:
Status: Offline
Joined: Dec 28, 2003
0.01 posts per day
Posts: 111
Points: 2,993
   


Originally posted by Milkman @ Thu Apr 15, 2004 10:03 pm:

I might be wrong on this, but in all of my Mysql scripts, when i output stuff, i use single quotes like
echo "<td>".$meetingdate['month']." ".$meetingdate['mday'].", ".$meetingdate['year']."</td>";


But, what exactly is the problem? Is it not outputing any information, are you getting errors and what are they?


The problem is thats it is not showing at all. if i insert the table in the top 10 list module it is showing all the rest (Top posters, top downloads, etc.) exept the one I want to ad extra.



_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#6   re: msql help
Milkman
CZ Super Newbie
Milkman has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Dec 28, 2003
0.01 posts per day
Posts: 45
Points: 2,228
   
What is $top set to? Is it possible this is set to 0 or not initialized and the query is not returning any thing?

Also, maybe try and test the query, maybe there is an error. so the code would look like $result = $db->mysql_query($sql) or die (mysql_error()); I think thats the syntax for catching the error code.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum