something like

<?
$result = mssql_query($sql);
for ($i=0;$i<mssql_num_rows($result);$i++) {
   mssql_data_seek($result,$i);
   $row = mssql_fetch_object($result);
   echo $row->someColumnInTable;
   echo $row->someOtherColumnInTable;
}
?>

---------- Original Message ----------------------------------
From: "louie miranda" <[EMAIL PROTECTED]>
Date: Fri, 4 Jan 2002 04:45:57 +0800

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
Charles Killmer
Netgain Technology
251-4700
--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to