MYSQL Data And <a href>

Discussion in 'MySQL' started by saadi123, Aug 2, 2010.

  1. #1
    I want to retrieve data from mysql database such that when the link is clicked, all the articles, related to particular categories are displayed on the page. That's right, I want to categorize my articles.

    So my question is that how do I use SQL queries in <a href> tags. (Of course we are going to need php). So can we use sql queries wrapped within php coding?

    Any suggestions?
     
    saadi123, Aug 2, 2010 IP
  2. beven

    beven Well-Known Member

    Messages:
    483
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    113
    #2
    show me your code with your table info...........
     
    beven, Aug 2, 2010 IP
  3. saadi123

    saadi123 Well-Known Member

    Messages:
    196
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #3
    Actually I have no code but I would try to explain what I want.
    Say for eg following the SQL query:
    SELECT post_title, post_body FROM table_name WHERE categories=xxx

    I want to wrap this query in php function and then anchor this php function in <a href> tag like:
    <a href="php function()>Anchor Text</a>
    Is this going to work? If not then what would be the most nearest possible simple alternate which generates the same result???
     
    saadi123, Aug 3, 2010 IP