Discussion Board

Results 1 to 3 of 3

Thread: PHP and MySQL

  1. #1
    Registered User
    Join Date
    Mar 2003

    PHP and MySQL

    Hi!!! Can anyone give me a simple example on how to connect my WML pages with PHP and MySQL? Thanks!!!

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Tampere, Finland

    RE: PHP and MySQL


    Database connection is made in the server side and makes no difference to normal PHP database connection. Your PHP code just needs to output valid WML for the device.

    There are plenty of tutorials available on the web covering this topic, please study:

    Best Regards,
    Mika / Forum Nokia Developer Support

  3. #3
    Registered User
    Join Date
    Mar 2003

    RE: PHP and MySQL

    Wml page with PHP is something like this...

    <?php /* be sure that the code starts at the
    very beginning of the page. Otherwise you'll have
    Error: headers already sent */
    header("Cache-Control: no-cache, must revalidate"
    header("Pragma: no-cache"
    header("Expires: Mon,26 Jul 2002 05:00:00 GMT"
    // those 3 lines above just if you don't want the page to be cached
    header("Content-type: text/vnd.wap.wml"
    echo "<"."?xml version=\"1.0\"?".">";
    ?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
    <card id="main">
    Hello world!

    Then you can connect to DB as usual and take what you nedd in place of "hello world". Remind that some chars are not well supported by all phones. For istance a record, expecially here in Italy, can have letters like et cetera...
    These letters may have the page not to be shown at all.
    Use a function to replace any occurance of with a' ...and so on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts