Re: PHP Command line script

From: Date: Tue, 01 May 2007 22:20:18 +0000
Subject: Re: PHP Command line script
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-254212@lists.php.net to get a copy of this message
Daniel Brown wrote:
    First and foremost, it's a VERY BAD idea to use root for MySQL.  If your code isn't perfect (and even sometimes if it is), arbitrary commands and SQL injection attacks could lead to migraines that no Tylenol will ever be able to alleviate.
I changed the user I was connecting as in order to post.  I don't use root in the real code.
    Secondly, what error is the CLI kicking out when you run it from the command line?
It doesn't give an error.  The only thing it does is continue on through the IF statement, which goes nowhere.  I have added an ELSE to the script and run it.  It ends up running the code in the ELSE.
    $login = date('m\-d\-Y');
    if ($logout = $mysqli->prepare("UPDATE mydb.authlog SET
    logout  = ? WHERE login LIKE '$login%'")) { // <--- Will not
    go any further than here, even when hard coding the information.
      $logout->bind_param("s", date('m\-d\-Y\TH\:i\:s'));
      $logout->execute();
      $logout->close();
    }
-- Nathaniel Hall, GSEC GCFW GCIA GCIH GCFA Spider Security


« previous php.general (#254212) next »