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 djh101's Avatar
    Join Date
    May 2009
    Location
    California
    Posts
    614
    Thanks
    48
    Thanked 64 Times in 64 Posts

    Fetching a single value- do I still need to use mysql_fetch_array?

    This has never actually come up before until now. If I want to fetch only a single value from a single row of a table, is is there still a need to use mysql_fetch_array or is there another way to set a variable equal to the extracted value?
    PHP Code:
    $query mysql_query("SELECT id FROM row WHERE id=1");
    $array mysql_fetch_array($query);
    $value $array[0]; 
    Last edited by djh101; 07-13-2011 at 11:19 PM.
    "Yeah science!"
    Online Science Tools

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    djh101 (07-13-2011)


  •  

    Posting Permissions

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