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
    New Coder
    Join Date
    Mar 2009
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    MySQL Help needed with looking up a record based on a defined element

    Hi
    I'm a newbie to MySQL as you will no doubt guess from my quetion, so please be gentle! hehe

    Ok my question, I have the following code:

    $link = @mysql_query("select *, $element AS text FROM script_data");

    mysql_query($queryis) or die(mysql_error());

    echo "<br><br>Total: <b>&#36;$total</b><br><br>";

    echo "Result: ($link) $element<br><br>";

    When I test the results I get the $element field to display the correct ID the script_data table but the $link field returns Resource id #7

    Where am I going wrong?

  • #2
    New Coder
    Join Date
    Mar 2009
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Sorry I forgot to mention my script_data table as 2 fields id & text
    $id has already been defined as $element, so you know the connection there!

    Thanks

    Rob


  •  

    Posting Permissions

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