Results 1 to 10 of 10

Thread: Retreive data from recordset

  1. #1
    Join Date
    Mar 2004
    Posts
    12

    Retreive data from recordset

    I have created a admin.php that display some coulmns of all records in the recordset. Last column disply as "View Detail" that link to the Detail page for update one record. The link used TagID as prameter. I have trouble with show tahe record in the detail page. I got blank page when I link to detail. http://localhost/InventoryDetail.php?000001=

  2. #2
    Join Date
    Jan 2004
    Location
    Cincinnati, OH
    Posts
    30
    I'm not sure if this is what you mean, but it looks like you should do something like the following:

    http://localhost/InventoryDetail.php?TagID=000001

    In your URL, 000001 would be the name of a variable, whereas it looks as if it should be the value of the variable TagID. So list TagID first in your URL with an equal sign, and then the TagID of the record that you want to be able to view. Then perform your database query on $TagID (which will be 000001).

    I hope this helps.

  3. #3
    Join Date
    Mar 2004
    Posts
    12
    Thanks for the help.
    Now I always get first record in the recordset.
    The URL as:
    http://localhost/FixedAsset/detailinv.php?tagid=

    no matter I click which record.

    I did fill in the UPL paremeter box: Name: TagID, Value: pick the TagID in the Invoice recordset. It shows like:
    detailinv.php?tagid=<?php echo $row_invoice['tagid']; ?>

    Why it can't pass the TagID to detailinv.php ?

    Could you please what I did missing?

    Thanks so much!

  4. #4
    Join Date
    Jan 2004
    Location
    Cincinnati, OH
    Posts
    30
    Does the id value show up in the URL of the link when you hover over the link?

  5. #5
    Join Date
    Jan 2004
    Location
    Cincinnati, OH
    Posts
    30
    It could be that your server is set with register_globals 'on'.

    Try to retrieve your variables using ->

    if ( isset( $_GET['tagid'] ) )


    Note: for "$_GET" :

    You need to use the correct global variable, ie: $_GET, $_POST, $_COOKIE, $_ENV, $_REQUEST...

  6. #6
    Join Date
    Mar 2004
    Posts
    12
    Dreamweaver MX created a tons of codes.
    they have some like $GET_. Where I can set register_global 'On'?

    I set a recordset from detailInv.php.
    SQL is SELECT * FROM core
    WHERE TagID=VarTagID

    In variables section:

    Name: VarTagID
    Default value: 000001
    Run-time Values: $Http_Get_VARS['TagID']

    TagID should get from the previous page, Inventory.php

    It didn't link correctly.

    URL is :http://204.61.183.116/FixedAsset/Inventory.php.

    Anything wrong I made?

  7. #7
    Join Date
    Jan 2004
    Location
    Cincinnati, OH
    Posts
    30
    You may not want to turn register_globals ON as it opens up some security holes.

    If you want to do it though, here is some good information about it:

    http://us4.php.net/register_globals


    This page also says you can leave it off, and should be able to reference any variable via:

    <?php
    // We wouldn't know where $username came from but do know $_SESSION is
    // for session data
    if (isset($_SESSION['username'])) {

    echo "Hello <b>{$_SESSION['username']}</b>";

    } else {

    echo "Hello <b>Guest</b><br />";
    echo "Would you like to login?";

    }
    ?>

    I hope this helps.

  8. #8
    Join Date
    Mar 2004
    Posts
    12
    Okay, anything else can made incorrect link detail update page?

    ????

    Thanks for all your messages.

  9. #9
    Join Date
    Jan 2004
    Location
    Cincinnati, OH
    Posts
    30
    If you want to post your code, I can look at it, and see if I see any errors there. Other than that, I'm afraid all I could offer is guesses.

  10. #10
    Join Date
    Mar 2004
    Posts
    12
    The codes is too long to post it here, Dreamweaver MX created it. It would be great if I can attach it to your email account.

    Thanks.

Posting Permissions

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