Reply to Re: print "...."; Question

Your name:

Reply:


Posted by Jerry Stuckle on 03/19/06 21:06

Steff wrote:
> I am wandering if my code is making sense... I use a lot the print function.
> Is it weird in this case where I have to display an array ? I thought it
> would be better to have the entire array in php but now I am not sure if
> that makes sense. Can you tell me please ?
>
>
<code snipped>
>
> // thanks for looking!
>
>


It's all a matter of style. Personally, I don't use print for straight
HTML - I just code the HTML and go into PHP when I need it. Exceptions
are things like quick elements.

A quick look at your code (and I might have missed something) and it
looks like nothing before the connexion line requires PHP. So why even
have PHP there? Just code it as HTML.

Your while loop fetching the rows I would have similar, except I'd code
it as:

while ($row = oci_fetch_array($stmt,OCI_NUM))
{
echo "<option>" . $row[0] . "</option>";
}

You don't need two print statements and an echo here.

Again, you have a bunch of print statements following this which are
just displaying HTML code - no PHP variables, etc. So why even
complicate things by using PHP? Just do the straight HTML code.

And so on.

The bottom line is - my first order of business is coding clarity. When
you have a lot of just HTML code, it complicates matters to put them in
print or echo statements. It takes longer to process as PHP than it
does to just output the straight html. So why do it?



--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация