- Original Message -
From: "David Freedman" <[EMAIL PROTECTED]>
To:
Sent: Friday, February 25, 2005 11:27 PM
Subject: [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
You should use a _ instead.
Please have a look at the mySQL manual:
http://dev.mysql.com/doc/mysql/en/string-comparison-functions.html
Christian
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 ";
Hello David,
Friday, February 25, 2005, 1:27:54 PM, you wrote:
D> Can the '*' be used? What am I doing wrong.
It's the % symbol, not the *.
--
Leif (TB lists moderator and fellow end user).
Using The Bat! 3.0.2.3 Rush under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 51
Not exactly clear what database you're using. In SQL Server the syntax
is
SELECT [options]
FROM [table]
WHERE [field] LIKE '%whatever value you're looking for%'
The % means any string of characters, so it doesn't have to be exact
Best of luck
Nate Tobik
(412)661-5700 x206
VigilantMinds
-O
4 matches
Mail list logo