Get data from Database???

Discussion in 'Programming' started by expertmac, Apr 16, 2011.

  1. #1
    Hello,

    I want help in php mysql.i have many category's & articles in Databse & i want get data by category,& i use this code
    $result = $database->query("SELECT DISTINCT cat_title FROM category ORDER BY cat_title ASC");
    HTML:
    i got here all articale from all categoty but i want from spacifice one category so how to filter this please provide me code...


    Thanks for all of supporters
     
    expertmac, Apr 16, 2011 IP
  2. malinda

    malinda Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    its better to keep 2 tables.. do u know about normalization. for your problem if you need to get specific articles you need to provide category id
    SELECT * from category where cat_id = "your cat id"
     
    malinda, Apr 17, 2011 IP
  3. expertmac

    expertmac Member

    Messages:
    78
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    46
    #3
    ya i got it...thanks mate its working
     
    expertmac, Apr 19, 2011 IP