You are here: SV: [PHP] Difficulty with SQL LIKE clause « PHP « IT news, forums, messages
SV: [PHP] Difficulty with SQL LIKE clause

Posted by Wiberg on 09/28/82 11:09

Hi there!

A little off-topic but what the heck (it's a more MySQL - related question)

Is 197* a numbertype field?
Try maybe $query= "SELECT * FROM my_table WHERE Year LIKE '197*'";

/G
@varupiraten.se

-----Ursprungligt meddelande-----
Från: David Freedman [mailto:eatc7402@comcast.net]
Skickat: den 25 februari 2005 21:28
Till: php-general@lists.php.net
Ämne: [PHP] Difficulty with SQL LIKE clause


When I use this query in PHP it works, and I get all things with the YEAR of
1977, as I expected.

$query= "SELECT * FROM my_table WHERE Year LIKE 1977 ";

But, when I use this query it does not work.

$query= "SELECT * FROM my_table WHERE Year LIKE 197* ";

I thought I should get the result of ALL things with the years in the 1970's
(1970-1979). But the asterisk in the LIKE clause does not seem to work.
I have tried various syntax's to try to get the 197* recognized but without
any luck.

Can the '*' be used? What am I doing wrong.

David F.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 2005-02-22

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 2005-02-22

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация