n00b here, I'm having trouble with this code fragment...
Posted: Tue Nov 26, 2002 10:05 am
I think I'm trying to run before I walk, but here goes...
I'm querying a MySQL DB via an .html page. I can connect, and the query is good, but the form drop downs are filled with the query code. It's like I'm missing a parens somewhere. Here is the code:
MYSQL_CONNECT(x.x.x.x, somename, somepass) OR DIE("Unable to connect to the database");
@mysql_select_db("syslogd") or die("Unable to select database");
<table>
<tr>
<?
echo "<td><b>Router</b> <select name=host>;
$xxx = "no data!";
$val = mysql_query("SELECT DISTINCT MsgHostname from syslogd");
echo "<option>*\n";
while ($row = mysql_fetch_array($val))
{
$host=$ow["MsgHostname"];
echo "<option>".$host."\n";
}
echo "</select>\n";
?>
</tr>
---------------
The drop downs are filled with the code starting here:*\n";while ($row = mysql_fetch....
Thanks!!!!!
R
I'm querying a MySQL DB via an .html page. I can connect, and the query is good, but the form drop downs are filled with the query code. It's like I'm missing a parens somewhere. Here is the code:
MYSQL_CONNECT(x.x.x.x, somename, somepass) OR DIE("Unable to connect to the database");
@mysql_select_db("syslogd") or die("Unable to select database");
<table>
<tr>
<?
echo "<td><b>Router</b> <select name=host>;
$xxx = "no data!";
$val = mysql_query("SELECT DISTINCT MsgHostname from syslogd");
echo "<option>*\n";
while ($row = mysql_fetch_array($val))
{
$host=$ow["MsgHostname"];
echo "<option>".$host."\n";
}
echo "</select>\n";
?>
</tr>
---------------
The drop downs are filled with the code starting here:*\n";while ($row = mysql_fetch....
Thanks!!!!!
R