
May 27th, 2003, 02:13 PM
|
|
5B's
|
|
Join Date: Oct 2002
Location: PC, FL
Posts: 364
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6
|
|
well from the piece of code you posted, you are making 1 database connection, identified by $connection. You are making 2 database queries.
Quote: | How can this be written better? |
what I like to do is move static variables into 1 file or into an array.
PHP Code:
$foldernamelinks = "webpages";
I would put code like this in a config file rather then in the actual code.
another thing I might do is get rid of $display1 and make a function out of it. maybe call it, display_link()
PHP Code:
function display_link($foldernamelinks, $title, $name)
{
echo("
<li>
<a href='$foldernamelinks/$title'>$name</a><br>
</li>");
}
then call it in the code where you need it
PHP Code:
<?php display_link($foldername, $title, $name); ?> </ul></td>
As long as it works, it is up to you 
__________________
-- Jason
|