|
Posted by Janwillem Borleffs on 10/19/78 11:41
Jeff Silverman" <""\"Remove the letters in all caps\" <jeff\ wrote:
> I have a PHP program that almost works. I'm running it from the
> command line and simulating a form using a GET method. That part is
> working, but I get spurious records with all of the fields concatenated
> into a
> single field.
>
[...]
> <small>This document last modified
> <script>document.writeln(document.lastModified)</script>.</small>
>
You are using PHP, no use for JS here:
<small> This document last modified
<?php print date("F d Y H:i:s.", getlastmod()) ?></small>
> $sql = "SELECT name, location, kernel, distribution, sysadmin, ip,
> mac, vendor_sn, real_num
> FROM computers WHERE name LIKE '".$hostname."%' ORDER BY name
> ASC";
You are selecting 9 fields from each row...
> print(" <tr>\n");
> for ($field=0; $field<4; $field++ ) {
> print(" <td>$row[$field] </td>\n");
> };
> print(" </tr>\n");
>
....but are only using the 4 first fields from each row?
Why not doing something like:
print "<tr>\n\t<td>";
print implode("</td>\n\t<td>", $row);
print "</td>\n</tr>";
JW
Navigation:
[Reply to this message]
|