Try using "LIKE" instead of "=":

$sth = $dbh->prepare("SELECT * FROM Years WHERE Date LIKE '2002-%'");
$sth->execute();


On Wed, 2002-01-23 at 17:09, Jason Whitlow wrote:
> 
> I am trying to do a select statement but am having problems with the "%"  in
> my string.
> 
> I am trying to 
> 
> $sth = $dbh->prepare("SELECT * FROM Years WHERE Date = '2002-%'");
>         $sth->execute();
> 
> I just get nothing.  No Error messages, nothing.  All other sql statements
> work just fine. Is it something with the mysql.pm in regardes to the %
> sign??
> 
> 
> Thanks for any help.
> 
> Jason
> 
> Senior Network Engineer
> Jason Whitlow
> wk-714-384-3456
> cell-714-412-7299
> 1221 E. Dyer Suite 150
> Santa Ana, CA. 92705
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 

-- 
Diana Soares


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to