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

    Join Date
    Sep 2010
    Rep Power

    Query returning strange resource


    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

    $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?

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Rep Power
    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