for wap pages you should output proper WML as far as database is concerned you can do it normally in php as usual ,, perform the queries grab the results and then display them in proper WML format ,, for php you just need to insert proper headers before output anything in the page ..if you want...