Re: printing php variable into html > print $result; ?

From: Date: Thu, 03 Jan 2002 21:04:54 +0000
Subject: Re: printing php variable into html > print $result; ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-79363@lists.php.net to get a copy of this message
use $sql = "select ...... "; $result = mysql_query($sql); echo $sql; --- louie miranda <louie@chikka.com> wrote: > Hi, is it possible to print the sql query? i mean > i want to print the output of the command "SELECT * FROM > members;" > and output it into html, i tried > > print $result; -- it gives me different output.. > > > Resource id #2 > > > ty, > louie... > > # PHP SCRIPT > ############################################### > > <html> > <body> > > <?php > > $db = mysql_connect("my_db_host", "my_db_user", > "my_db_pass") > or die("Could not connect"); > > mysql_select_db("cavite",$db); > > $result = mysql_query("SELECT * FROM members",$db) or > die("Error:".mysql_error() > ); > > printf("ircname: %s<br>", > mysql_result($result,0,"ircname")); > printf("email: %s<br>", mysql_result($result,0,"email")); > printf("realname: %s<br>", > mysql_result($result,0,"realname")); > printf("asl: %s<br>", mysql_result($result,0,"asl")); > printf("info: %s<br>", mysql_result($result,0,"info")); > > print "<br><br>"; > > ?> > > </body> > > </html> > > # PHP SCRIPT > ############################################### > > > -- > 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 > ===== Mehmet Erisen http://www.erisen.com __________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com

« previous php.general (#79363) next »