note 19437 added to function.strtotime
| From: | msopacua at idg dot nl | Date: | Wed, 27 Feb 2002 16:38:32 +0000 |
| Subject: | note 19437 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27121@lists.php.net to get a copy of this message | ||
What you should or shouldn't do, totally depends on your context.
For instance, using format functions in WHERE clauses, disables the use of the index on that field
in mySQL
I tried the EXPLAIN on postgres, but that doesn't give me much information
And something like this:
<?php
class task
{
function task($db, $id)
{
$sql="SELECT * FROM tasks WHERE id='$id'";
$rs=pg_exec($db, $sql);
$row=pg_fetch_row($rs);
foreach($row as $key => $value)
{
$this->$key=$value;
}
}
}
?>
becomes totally unusable.
While it is questionable to parse date-output as a string, because one depends on both the DB output
and the php parser not changing, it can be quite useful.
--
http://www.php.net/manual/en/function.strtotime.php
http://master.php.net/manage/user-notes.php?action=edit+19437
http://master.php.net/manage/user-notes.php?action=delete+19437
http://master.php.net/manage/user-notes.php?action=reject+19437