Are you sure this is a php issue not a Database issue? What backend database are you using, and are you using the same database with ASP and PHP?
This may help find a solution...
ALSO... you can do a die($sql) just before you execute the query command, and you should be albe to see the exact statement being run on the database. Then compare this with what you get from ASP... If I remember correctly you can do a Response.Write() in ASP to show you your query.
Thanks
PHPdev