Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Lucifix
Regular
Regular



Joined: Mar 11, 2005
Posts: 67

PostPosted: Sat Mar 26, 2005 10:10 am Reply with quote

I have added new field in nuke_reviews table called CAT <- as category.

If I add cat number:
1 <- photoshop review
2 <- book review
3 <- movie review

Now I would like to see right block only in Photoshop reviews (cat no. 1).

After:
Code:
$pagetitle = "- $module_name";


I added:

Code:
   if ($cat == 1) {

$index = 1;
     } else {
$index = 0;
    }


Of course it didn't work.

Does anyone else have idea how to do that?
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Mar 26, 2005 10:43 am Reply with quote

How is $cat being populated? You would have to place that code after a call to your MySQL reviews table. Normally that hasn't happened before the $pagetitle statement.
 
View user's profile Send private message
Lucifix







PostPosted: Sat Mar 26, 2005 10:55 am Reply with quote

I did one test...

instead of $cat I inserted $id and change number 1 to number of random review, which worked.

But I can't find anywhere where $id is populated Sad
 
Lucifix







PostPosted: Sat Mar 26, 2005 11:00 am Reply with quote

I tried this but without it didn't work:


Code:
$result = sql_query("SELECT cat FROM ".$prefix."_reviews", $dbi);

while(list($cat) = sql_fetch_row($result, $dbi)) {

   if ($cat == 1) {
$index = 1;
     } else {
$index = 0;
    }
    }
 
Raven







PostPosted: Sat Mar 26, 2005 11:24 am Reply with quote

I have no idea why you mention $id? Put this statement right ahead of your if test: die($cat);
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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 ©