Re: simple querying mysql in a WML card problem :(

From: Date: Wed, 25 Apr 2001 20:01:14 +0000
Subject: Re: simple querying mysql in a WML card problem :(
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50343@lists.php.net to get a copy of this message
Hi Sandeep, The <br> tag looks like this in wml: <br/> Have you escaped the doublequotes correctly in your double quoted "echo" 's? Make sure that the database doesn't contain ampersands, or dollar signs, or some of the foreign lettering (like é), as they are illegal characters in wml (well, the dollar sign is used for variables, like PHP, but WML can't accept them as part of a string as PHP does). Ways to work around: $string = ereg_replace("&", "", $string); or $string = ereg_replace("&", "&amp;", $string); To get a dollar, use two dollars: $string = ereg_replace("$", "$$", $string); That's about as much I can suggest, without actually playing with the script myself.... And I am too tired for that. :) James "Sandeep Hundal" <sandeep_wde@yahoo.com> wrote in message news:20010425175614.1122.qmail@web3904.mail.yahoo.com... > hi all! > > i'm trying to get simple 2 line results from mysql in a wml card, but > i can't seem to manage it. here's my code: > > > <? > header("Content-type: text/vnd.wap.wml"); > header("Cache-Control: no-cache, must-revalidate"); > header("Pragma: no-cache"); > echo ("<?xml version='1.0'?>"); > ?> > > <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" > "http://www.wapforum.org/DTD/wml_1.1.xml">"; > > > <? > include ("db.php"); > $query1 = "SELECT club FROM table WHERE day='monday' "; > > echo " > <wml> > <card id="card1" title="clubbing by day"> > <p>"; > > $result1 = mysql_query($query1); > if ($result1) { > echo " $day <br>"; > while ($r1 = mysql_fetch_array($result1)) { > extract($r1); > echo "$clubdetails <br>"; > } > } > > mysql_free_result($result1); > > echo " </p> > </card> > </wml>"; > > ?> > > simple? yet all it seems to give m is : > -------------------- > ; = mysql_query( if ( { echo " > ; while ( = mysql_fetch_array( { extract( echo " > ; } }mysql_free_result( " > --------------------- > > in my emulator (WinWAP). > > Any help greatly appreciated! > > /sandeep > > ____________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk > or your free @yahoo.ie address at http://mail.yahoo.ie > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#50343) next »