Re: convertion from string to time & substracting

From: Date: Fri, 07 Jun 2002 18:44:06 +0000
Subject: Re: convertion from string to time & substracting
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-101171@lists.php.net to get a copy of this message
----- 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 :-)

« previous php.general (#101171) next »