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
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Confused about $info or $query

    Sorry if this is just a stupid stupid question, i notice on SQl Queries sometimes people use $info sometimes they use $query, is there a reason for this or is it pure preference?

  • #2
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Preference. I use this way:

    $query = "query";
    $result = mysql_query($query);
    $row = fetch_array($result);

    I can't stand this

    $query2
    $result2....

    But If I have a function and I am returning say "user_info" Then in my function i have the query info then I put the array into that variable like so.

    PHP Code:
    function get_user_info() {
        
    $query "Select *";
        
    $result mysql_query($query);
        
    $row mysql_fetch_array($result);

        return 
    $row;
    }

    $user_info get_user_info(); 
    Last edited by iLLin; 04-08-2007 at 03:56 PM.


  •  

    Posting Permissions

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