RE: [PHP] convertion from string to time & substracting
| From: | John Holmes | Date: | Fri, 07 Jun 2002 18:53:42 +0000 |
| Subject: | RE: [PHP] convertion from string to time & substracting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101174@lists.php.net to get a copy of this message | ||
Okay, sorry. I stand corrected. :)
Either way, the query still failed for some reason. The recommendation
to use MySQL_error() is still a good one...
---John Holmes...
> -----Original Message-----
> From: Chris Knipe [mailto:savage@savage.za.org]
> Sent: Friday, June 07, 2002 2:44 PM
> To: holmes072000@charter.net; php-general@lists.php.net
> Subject: Re: [PHP] convertion from string to time & substracting
>
> ----- Original Message -----
> From: "John Holmes" <holmes072000@charter.net>
> To: "'juaid'" <juaid@juanin.com>; <php-general@lists.php.net>
> Sent: Friday, June 07, 2002 8:29 PM
> Subject: RE: [PHP] convertion from string to time & substracting
>
>
> > That error means your query failed and the result set is not valid.
You
> > can't use LIKE on a TIME column.
>
> Since when?????
>
> mysql> describe blah;
> +-----------+------------+------+-----+----------+----------------+
> | Field | Type | Null | Key | Default | Extra |
> +-----------+------------+------+-----+----------+----------------+
> | ID | tinyint(4) | | PRI | NULL | auto_increment |
> | TimeStart | time | | MUL | 00:00:00 | |
> +-----------+------------+------+-----+----------+----------------+
> 2 rows in set (0.00 sec)
>
> mysql> SELECT * FROM blah;
> +----+-----------+
> | ID | TimeStart |
> +----+-----------+
> | 1 | 10:00:00 |
> | 2 | 01:00:00 |
> | 3 | 11:00:00 |
> | 4 | 12:00:00 |
> | 5 | 12:12:00 |
> | 6 | 11:12:00 |
> +----+-----------+
> 6 rows in set (0.00 sec)
>
> mysql> SELECT * FROM blah WHERE TimeStart LIKE '12%';
> +----+-----------+
> | ID | TimeStart |
> +----+-----------+
> | 4 | 12:00:00 |
> | 5 | 12:12:00 |
> +----+-----------+
> 2 rows in set (0.04 sec)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> You just need to have the correct syntax in the LIKE clause :-)