Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
Bigboy177
Worker
Worker



Joined: Jul 07, 2004
Posts: 192

PostPosted: Sat Jul 31, 2004 11:57 am Reply with quote

I've got a scrolling block... Everything is working OK... But I want to add one more thing to the block... I would like this block to show the category of the content it's showing...
This is how the sript looks like:

Code:


$result = $db->sql_query("SELECT pid, title FROM ".$prefix."_cnb_pages ORDER BY pid DESC LIMIT 0,5"); //you can set this from 5 - 15 do not change the "0" if you want the most recent stories included.
    while ($row = $db->sql_fetchrow($result)) {
    $bazapid = $row['pid'];
    $baza = $row['title'];
   
      $scroll .= "<div align=\"left\"><strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=Conteudo&pa=showpage&pid=$bazapid\"><b><font color=\"red\">$baza</font></b></a></div>";
      
    }
    $scroll_count++;


I would like a Category name at after the $baza...

Can someone help... I tried to do it by my self but it's not working like it should be...
The table of categories is called _cnb_pages_folder... The $cid is the category number and $title is categories name...
It's a little complicated because there's also a $mid var in the _cnb_pages_folder... So it would have to be something like this... Read the $cid from the _cnb_pages, than compare it to the $cid from _cnb_pages_folder, then from _cnb_pages_folder read the $mid where $cid from _cnb_pages and _cnb_pages_folder are the same... And than compare the $mid from _cnb_pages_folder with the $cid from the table _cnb_pages_folder and if they match read the $title category...

Please help... If you want I can make screenshots of these tables so you can see what I mean... I hope it's not too complicated...
 
View user's profile Send private message
Bigboy177







PostPosted: Sat Jul 31, 2004 1:06 pm Reply with quote

I think that I made it all mixed up...

Here's the simpler explanation...
I need to take $cid form _cnb_pages_folder where $cid is the same as in_cnb_pages...
Than take $Title form the table _cnb_pages_folder where $mid from this table is the same as $cid from this table...

Maybe now it's a little clearer... I don't know how to do it... Please help...
 
Bigboy177







PostPosted: Sat Jul 31, 2004 4:46 pm Reply with quote

Maybe someone could atleast point me to the module or a block in which such SQL querries are used... so I can figure out how it works... Because I really don't know where to start... Please help...
 
Muffin
Client



Joined: Apr 10, 2004
Posts: 649
Location: UK

PostPosted: Sat Jul 31, 2004 5:28 pm Reply with quote

It's no good me offering to help you lost me on the first sentence lol

Sorry.

I know how frustrating it is when you cant get something to work, because I'm pretty useless myself at doing stuff with the code.

I'm sure Raven will answer you when he comes online, he's usually very fast at helping people out, but it is the weekend so maybe he is busy at home right now.

_________________
Classic Mini rules the bends & bends the rules!
[img] 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©