[thelist] php design question
Tom Dell'Aringa
pixelmech at yahoo.com
Mon Nov 18 16:06:01 CST 2002
I'm building an application that is going to reuse a fair amount of
code. I'm wondering if a) its bad form to have an include within an
include, and b) if I should be using an include for the get item as I
am doing below - see code:
-------
$result = @mysql_query("SELECT * FROM menuitem WHERE menuitemID =
'$id'");
if(!$result)
{
echo(include('includes/db_error.php'));
exit();
}
$row = mysql_fetch_array($result);
$item = $row['item'];
$description = $row['description'];
$price = $row['price'];
$categoryID = $row['categoryID'];
--------
I want to make this whole code block an include, because there will
be several pages where I pull the menu item. Does this make sense?,
and see the nested include...
Tom
=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
More information about the thelist
mailing list