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
n00b here, I'm having trouble with this code fragment...
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Wow, you guys are good! I was "sure" that it was configured properly. I needed to do a few more steps.
But... Now, it is giving me this:
Parse error: parse error, expecting `','' or `';'' in /home/httpd/html/syslogstat/index.html on line 17
Line 17 is this one: $xxx = "no data!";
I've tried sever things, and cannot seem to locate it in the docs. Can you guys work you magic one more time? What do I need to do?
THANKS!
But... Now, it is giving me this:
Parse error: parse error, expecting `','' or `';'' in /home/httpd/html/syslogstat/index.html on line 17
Line 17 is this one: $xxx = "no data!";
I've tried sever things, and cannot seem to locate it in the docs. Can you guys work you magic one more time? What do I need to do?
THANKS!
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
The error is actually occuring on the line above:
You're missing a closing quote on the string, try:
Mac
Code: Select all
echo "<td><b>Router</b> <select name=host>;Code: Select all
echo '<td><b>Router</b> <select name="host">';