#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2010
    Posts
    15
    Rep Power
    0

    Query returning strange resource


    Hello

    I am running a MySQL query from my php page but it is returning a whole host of resources instead of a result...

    This is the code


    Code:
    $query = "SELECT activate_shutdown_process, IF(NOW() > shutdown_time, -1, MINUTE(TIMEDIFF(shutdown_time, NOW()))), estimated_maintenance_period_in_mins FROM server_shutdown_settings";
    
    $result = mysql_query($query, $db);
    Where activate_shutdown_process = 1, shutdown_time = mid day today and estimated_maintenance_period_in_mins = 720 (12hrs)

    If I echo out the result I get a resource and if I echo out a print_r of the result I get a resource as well...

    Any ideas?

    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,700
    Rep Power
    595
    Please use [ PHP ] tags around your PHP script rather than [ CODE ] tags. See ManiacDan's New User Guide.

    You are getting exactly what you should. That call returns a result resource. You use that resource to fetch the data.

    Rather than give you the code to do that I instead urge you to switch to PDO rather than the depreciated MySQL library.

    Comments on this post

    • badger_fruit agrees : Yup, what he said ^^
    There are 10 kinds of people in the world. Those that understand binary and those that don't.

IMN logo majestic logo threadwatch logo seochat tools logo