RE: [PHP-WIN] RE: [PHP] Re: Using date() function
| From: | John W. Holmes | Date: | Sun, 06 Oct 2002 14:28:14 +0000 |
| Subject: | RE: [PHP-WIN] RE: [PHP] Re: Using date() function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119001@lists.php.net to get a copy of this message | ||
> Hi John,
>
> How do u use UNIX_TIMESTAMP or DATE_FORMAT in your query. My query now
> looks like this:
>
> "SELECT * FROM guestbook2002 ORDER BY entryID DESC LIMIT $entry,
$show";
>
> Can u help me;-) Thanks for your time
Did you read the Date and Time Functions chapter of the MySQL manual??
SELECT UNIX_TIMESTAMP(your_timestamp_column) AS alias FROM your_table
...
SELECT DATE_FORMAT(column,'<format>'), column2, column3, etc FROM
yourtable ...
You have to name the columns and not use * in your query. You'll also
want to read up on the AS alias, if you don't know what that is.
---John Holmes...