×

Discussion Board

Results 1 to 3 of 3

Thread: PHP and MySQL

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    6

    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
    Location
    Tampere, Finland
    Posts
    67

    RE: PHP and MySQL

    Hi,

    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:
    http://www.edevcafe.com/docs/44.html
    http://www.phpbuilder.com/columns/baravalle20010221.php3
    http://www.zend.com/zend/tut/wap.php

    Best Regards,
    Mika / Forum Nokia Developer Support

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    11

    RE: PHP and MySQL

    hi,
    Wml page with PHP is something like this...
    <pre>

    <?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">
    <wml>
    <card id="main">
    <p>
    Hello world!
    </p>
    </card>
    </wml>

    </pre>
    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.
    Ciao
    Filippo

Posting Permissions

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