PHP WML Mysql

This is a discussion on PHP WML Mysql within the PHP Language forums, part of the PHP Programming Forums category; I am trying to convert this file so that I can use it with a WAP Emulator to WML. Can ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-05-2004
Dom
 
Posts: n/a
Default PHP WML Mysql

I am trying to convert this file so that I can use it with a WAP
Emulator to WML. Can anyone help me to convert it. I have tried what I
thought was correct but keep getting error messages.

<html>



<body>



<?php



$db = mysql_connect("localhost", "root");



mysql_select_db("mydb",$db);



$result = mysql_query("SELECT * FROM employees",$db);



printf("First Name: %s<br>\n", mysql_result($result,0,"first"));



printf("Last Name: %s<br>\n", mysql_result($result,0,"last"));



printf("Address: %s<br>\n", mysql_result($result,0,"address"));



printf("Position: %s<br>\n", mysql_result($result,0,"position"));



?>



</body>



</html>



Also can anyone recommend a good WAP Emulator to use with Mysql and
PHP.
Reply With Quote
  #2 (permalink)  
Old 09-05-2004
Janwillem Borleffs
 
Posts: n/a
Default Re: PHP WML Mysql

Dom wrote:
> I am trying to convert this file so that I can use it with a WAP
> Emulator to WML. Can anyone help me to convert it. I have tried what I
> thought was correct but keep getting error messages.
>


WML is NOT HTML. Per example, the following:

<html>
<body>
<br>
</body>
</html>

will be the following in WML:

<wml>
<card id="myCard" title="Some title">
<br />
</card>
</wml>

Read up on the WAP protocol before you continue. A good place to start is:

http://www.openmobilealliance.org/te.../wapindex.html


JW



Reply With Quote
  #3 (permalink)  
Old 09-06-2004
Dom
 
Posts: n/a
Default Re: PHP WML Mysql

I understand the principles of WML. I was just wondering whether it is
possible to easily convert this HTML page into a page that can be used
for WAP. I have tried to make a few modifications to change it into a
WML page, but I kept getting errors about the PHP.

Any help would be greatly appreciated.






"Janwillem Borleffs" <jw@jwscripts.com> wrote in message news:<413b121e$0$58989$b83b6cc0@news.euronet.nl>.. .
> Dom wrote:
> > I am trying to convert this file so that I can use it with a WAP
> > Emulator to WML. Can anyone help me to convert it. I have tried what I
> > thought was correct but keep getting error messages.
> >

>
> WML is NOT HTML. Per example, the following:
>
> <html>
> <body>
> <br>
> </body>
> </html>
>
> will be the following in WML:
>
> <wml>
> <card id="myCard" title="Some title">
> <br />
> </card>
> </wml>
>
> Read up on the WAP protocol before you continue. A good place to start is:
>
> http://www.openmobilealliance.org/te.../wapindex.html
>
>
> JW

Reply With Quote
  #4 (permalink)  
Old 09-06-2004
Janwillem Borleffs
 
Posts: n/a
Default Re: PHP WML Mysql

Dom wrote:
> I understand the principles of WML. I was just wondering whether it is
> possible to easily convert this HTML page into a page that can be used
> for WAP. I have tried to make a few modifications to change it into a
> WML page, but I kept getting errors about the PHP.
>
> Any help would be greatly appreciated.
>


<?
header("Content-Type: text/vnd.wap.wml");
// In case open_short_tag support is enabled
print '<?xml version="1.0" encoding="iso-8859-1"?>'."\n";
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="myCard" title="Some title">
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
$result = mysql_query("SELECT * FROM employees",$db);

printf("First Name: %s<br />\n", mysql_result($result,0,"first"));
printf("Last Name: %s<br />\n", mysql_result($result,0,"last"));
printf("Address: %s<br />\n", mysql_result($result,0,"address"));
printf("Position: %s<br />\n", mysql_result($result,0,"position"));

?>
</card>
</wml>


JW



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:18 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0