how would i set out the sql for a categories table???

Discussion in 'PHP' started by Kurt Whittingham, Mar 10, 2012.

  1. #1
    Hello.
    i want to make a categories table in my data base.
    what would i include in the sql??
    Thanks
     
    Kurt Whittingham, Mar 10, 2012 IP
  2. irdogg

    irdogg Well-Known Member

    Messages:
    358
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    135
    #2
    need more info are you a coder? what script?
     
    irdogg, Mar 10, 2012 IP
  3. Kurt Whittingham

    Kurt Whittingham Member

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #3
    i am a coder but im very new to php, msql .

    and i have a website about motorbikes, and i want to have articles put into categories. so i need to make the categories into the data base.

    and if you know how to make pages into those categories that would be awesome

    Thanks Kurt
     
    Kurt Whittingham, Mar 10, 2012 IP
  4. MrPJH

    MrPJH Well-Known Member

    Messages:
    1,066
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    155
    #4
    first put categories in table
    then use query to get the results

    
    SELECT * from categories_table;
    
    PHP:
    * means every thing
    now on inner pages use as you wish
    like
    SELECT * from cat_table WHERE cat_id='1';
    PHP:
    use this on page where you want to get cat ID 1
     
    MrPJH, Mar 12, 2012 IP
  5. Kurt Whittingham

    Kurt Whittingham Member

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #5
    would that then make the pages in the categories??
     
    Kurt Whittingham, Mar 12, 2012 IP
  6. MrPJH

    MrPJH Well-Known Member

    Messages:
    1,066
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    155
    #6
    NO
    make categories in pages
    some thing like

    
    <?php
    <header>
    <aditional stylings>SELECT * from cat_table WHERE cat_id='catID';
    <footer>
    ?>
    
    PHP:
     
    MrPJH, Mar 15, 2012 IP
  7. Irfi0009

    Irfi0009 Banned

    Messages:
    17,584
    Likes Received:
    33
    Best Answers:
    1
    Trophy Points:
    48
    #7
    I am fresh php fresh developer i don't know how to do this
    Thanks
     
    Irfi0009, Mar 19, 2012 IP