Re: PHP Command line script
| From: | Richard Lynch | Date: | Wed, 02 May 2007 20:13:46 +0000 |
| Subject: | Re: PHP Command line script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254265@lists.php.net to get a copy of this message | ||
On Tue, May 1, 2007 3:13 pm, Nathaniel Hall wrote:
> <?php
> $mysqli = new mysqli('localhost', 'root', 'abc123',
> 'mydb');
> if (mysqli_connect_errno()) {
> echo "Unable to connect to database.\n";
> exit;
> } 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();
> }
//ALWAYS do your error-checking!!!
else{
die(mysqli_error());
}
//You may want to put the query in $query so you can print that
//as part of the 'die' output
> }
> $mysqli->close();
> ?>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?