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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts

    extract not working

    Hiya,

    This works:

    PHP Code:
    <?
    include ("connect.php");
    echo 
    "<title>Tourney Variables</title>";
    $tid 580;
    $result mysql_db_query(tourneys"SELECT * FROM info WHERE tid='$tid'");
    $row mysql_fetch_array($result);
    extract$row );
    echo 
    "TOURNEY URL: $url";
    ?>
    But this does not (leaves $t_url as blank):

    PHP Code:
    <?
    include ("connect.php");
    echo 
    "<title>Tourney Variables</title>";
    $tid 580;
    $result mysql_db_query(tourneys"SELECT * FROM info WHERE tid='$tid'");
    $row mysql_fetch_array($result);
    extract$row EXTR_PREFIX_ALL"t_" );
    echo 
    "TOURNEY URL: $t_url";
    ?>
    Any idea's why? I have tried both 't_' and "t_". Running PHP v4.2.1

    Thanks in advance

    Taylor.

  • #2
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts
    Nevermind - worked it out! Should be:

    PHP Code:
    <?
    include ("connect.php");
    echo 
    "<title>Tourney Variables</title>";

    $result mysql_db_query(tourneys"SELECT * FROM info WHERE tid='$tid'");
    $row mysql_fetch_array($result);
    extract$row EXTR_PREFIX_ALL"t" );
    echo 
    "TOURNEY URL: $t_url";
    ?>
    No underscore in front of the t!!

    Taylor.


  •  

    Posting Permissions

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