Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2005
    Location
    Queensland Australia
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Simple html link to data

    Hello,

    The site I am building needs several html links, from images, to variouse categories. There are two foreign keys in the table so there is no need for a join. I simply wish to search those fields and gather all the relevant numbers to display on the results page. The method is a link with the correct variable.

    The query:
    PHP Code:
    <?php require_once('Connections/sports_connect.php'); ?>
    <?php
    mysql_select_db
    ($database_sports_connect$sports_connect);
    $query_qLinks "SELECT department_id, cat_id, advert FROM entry";
    $qLinks mysql_query($query_qLinks$sports_connect) or die(mysql_error());
    $row_qLinks mysql_fetch_assoc($qLinks);
    $totalRows_qLinks mysql_num_rows($qLinks);
    ?>
    I am trying to get a "detail" link modified to send to the results page to where the data will be recieved.
    PHP Code:
    search_result.php?department_send=<?php echo $row_qLinks['department_id']; ?>
    Thanks

  • #2
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    I may be mistakenn, but don't you need a while() statement on that mysql_fetch_assoc() or a WHERE clause on the query?

  • #3
    New Coder
    Join Date
    Dec 2005
    Location
    Queensland Australia
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your reply Element, is this getting closer?

    PHP Code:
    <?php require_once('Connections/sports_connect.php'); ?>
    <?php
    mysql_select_db
    ($database_sports_connect$sports_connect);
    $query_qLinks "SELECT department_id, cat_id, advert FROM entry";
    $qLinks mysql_query($query_qLinks$sports_connect) or die(mysql_error());
    $row_qLinks mysql_fetch_assoc($qLinks);
    $totalRows_qLinks mysql_num_rows($qLinks);
    while (
    $result mysql_fetch_row($qLinks)){
            for (
    $i 0$i<count($record); $i ++)
            }
    ?>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •