Jump to content


Photo

if help please


  • Please log in to reply
2 replies to this topic

#1 feri_soft

feri_soft
  • Members
  • PipPipPip
  • Advanced Member
  • 147 posts

Posted 30 April 2006 - 07:32 AM

I have some files(about 20) for each category.I have a script to list the latest files and in the mysql table there is the catid.How to associate every catid with the correct file.If $categoryid = 1 for example
the link to the tut must be cat1.php?view=4
if category=2
the link must be cat2.php?view=70
and so on...
where $categoryid = $row[categoryid] is it correct?

Can you help me writing this script? I need it very much,please!

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 30 April 2006 - 01:27 PM

switch ($categoryid) {

     case 1:
                 $link = 'cat1.php?view=4';
                 break;

     case  2:
                $link = 'cat2.php?view=70';
                break;


     //etc
}

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 feri_soft

feri_soft
  • Members
  • PipPipPip
  • Advanced Member
  • 147 posts

Posted 30 April 2006 - 05:48 PM

But the tutorials are listed from a mysql database how to determine which gors for case 1 for case 2 etc??




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users