Jump to content

DarkWater

Members
  • Posts

    6,173
  • Joined

  • Last visited

    Never

Posts posted by DarkWater

  1. $qryRemHosts = sprintf("SELECT removed_hosts FROM usr_preferences WHERE uid IN('$s')", implode("', '", $uid));

     

    Try that.  Also, I don't like what you're doing with $arrLastServices.  That loop seems pointless and inefficient.

  2. Rather than writing your query and executing it all in one line, use a prepared statement so it can be echoed and put or die(mysql_error()) at the end of sql execution.

     

    $sql = "SELECT email FROM `' . $table . '`";
    echo $sql;
    mysql_query($sql) or die (mysql_error());

     

    That's not a prepared statement, by the way; that's just using a variable...

     

    Try something like:

    $sql = "SELECT email FROM $table";
    $result = mysql_query($sql) or die(mysql_error());
    

  3. @sam06: Use flyhoney's method.  In the one you have now, you're doing the query twice.  That wastes resources and it absolutely pointless.

     

    EDIT: Also, mysql_result() is pretty slow compared to the other fetching functions.  Use one of those as opposed to mysql_result().

  4. The point of OOP is not to just simply wrap procedural code into a bunch of static functions.  You might as well just have getLastUpdate(), getHosts(), etc. just as functions if that's how you're going to do it.  OOP allows you to emulate real-world objects and relations and structure your code around that.

  5. 3/5 computers in my house are on all day, every day.  The other 2 are laptops, so it would be kind of dumb to leave them on.  I have a backup power supply on my main box for blackouts, so it's REALLY always on.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.