$sql = "SELECT * FROM Vacation where StartDate LIKE '%s\\%s'";

That should work :)

Cheers,
Rob.

Tyler BIRD wrote:
> 
> hey I'm trying to make dynamic database queries using
> sprintf
> any way I can get around this error?
> 
> $sql = "SELECT * FROM Vacation where StartDate LIKE '%s/" .
> '\%' . "/%s'";
> $sql = sprintf($sql,  $_GET["month"],  $_GET["year"] );
> 
> I want just a literal slash between the month and year,
> printf seems to complain of to few
> arguments I've tried escaping the meaning of the % in the
> example above and still
> get errors
> 
> Thanks
> TYler
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-----------------.
| Robert Cummings |
:-----------------`----------------------------.
| Webdeployer - Chief PHP and Java Programmer  |
:----------------------------------------------:
| Mail  : mailto:robert.cummings@;webmotion.com |
| Phone : (613) 731-4046 x.109                 |
:----------------------------------------------:
| Website : http://www.webmotion.com           |
| Fax     : (613) 260-9545                     |
`----------------------------------------------'

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

Reply via email to