> <?
> connect_to_database();
> parse_query();
> execute_query();
> 
> echo "<TABLE>";
> 
> while (fetch_row_from_query())
> {
> $output = data_from_fetched_row();
> $more_output = more_data_from_fetched_row();
> 
> echo "<TR><TD> $output </TD><TD> $more_output </TD></TR>";
> 
> }
> echo "</TABLE>";
> ?>

Well, this may be a bit specific, but that is probably part of your problem.
You have no structure associated with your application design:

what are you doing making a connection to a database on the same page you
spit out the results from?

You should be including a wrapper file, and calling a function which talks
to the database.

Also, all of that logic should be in a file that is separate from the markup
_anyway_


 
> <?
> connect_to_database();
> parse_query();
> execute_query();
> ?>
> <TABLE>
> <? while (fetch_row_from_query()) : ?>
> 
> <?    $output = data_from_fetched_row();
> $more_output = more_data_from_fetched_row();    ?>
> 
> <TR><TD><?=$output?></TD><TD><?=$more_output?></TD></TR>
> 
> <? endwhile; ?>
> </TABLE>

<table>

<? function html_table_row($output, $more_output) { ?>
<tr>
<td valign="middle" bgcolor="#CCCCCC"><?=$output?></td>
<td valign="middle" bgcolor="#CCCCCC"><?=$more_output?></td>
</tr>
<? } ?>


</table>


> 
> 
> I _personally_ prefer the upper implementation, as all my web developing team
> (that is, only me :-) know both PHP and HTML and don't
> like the code to be *plagued* of <? ?> <? ?> <? ?> as in above example.

I digress.

_alex

> 
> 
> -- 
> 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]
> 


-- 
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