|
Posted by JDS on 10/13/50 11:28
On Wed, 05 Oct 2005 13:26:33 +0200, Sentinel wrote:
> php code
....is a horrible jumbled mess that I don't have time to decipher.
1) Don't print or echo lines of HTML, it just makes things very very messy
when there are large blocks of HTML. Instead, drop out of PHP and write
the HTML as plain HTML. Example:
<?php
echo "blah\n";
?>
<h1>blah blah</h1>
<h2><? echo $header2 ?></h2>
etc...
2) Use careful, proper, consistent formatting -- indents in consistent
places, brackets, curlies, and parens in consistent places. I think
that some of the mess may be an artifact of your news reader breaking
lines at around 80 chars. If this is the case, then dump the code into a
plain text file and put it on the web somewhere so I can look at it in my
browser.
As for your questions, you *do* know how many rows there are. That data
is in two places:
count($row_menuheader);
and
mysql_num_rows($r_menuheader);
Another suggetion, go to the PHP.net website and cut and paste their code
for looping through MySQL data sets. Then change the names to suit.
later...
--
JDS | jeffrey@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
Navigation:
[Reply to this message]
|