I got the code to work by changing the "WHERE url" to "WHERE location". But now I'm having trouble using a function to avoid repetition in the code. None of the modules are appearing...
<?php
$url = $_SERVER['PHP_SELF'];
$host = "asdf";
$username = "asdf";
$password = "asdf";
$database = "asdf";
$connect = mysql_connect($host, $username, $password);
$select = mysql_select_db($database, $connect);
$result = mysql_query($query);
$data = mysql_fetch_row($result);
function getModule() {
if (!$data[0]) {
}
else {
echo $data[0] . "\n";
}
}
// DOCTYPE & CHARSET
$query = sprintf("SELECT mod_code FROM mod_doctype_charset WHERE url='%s'", mysql_real_escape_string($url));
getModule();
// CONTENT: TITLE & META
echo "<title>Good Samaritan Network, Inc.</title>\n";
echo "<meta name=\"description\" content=\"\">\n";
echo "<meta name=\"keywords\" content=\"\">\n";
// LINKS
$query = sprintf("SELECT mod_code FROM mod_links WHERE url='%s'", mysql_real_escape_string($url));
getModule();
// BANNER
$query = sprintf("SELECT mod_code FROM mod_banner WHERE url='%s'", mysql_real_escape_string($url));
getModule();
// MENU
$query = sprintf("SELECT mod_code FROM mod_menu WHERE url='%s'", mysql_real_escape_string($url));
getModule();
// CONTENT: SECTION HEADING
echo "<div id=\"section-heading\">Good Samaritan Network</div>\n";
// SUBMENU
$query = sprintf("SELECT mod_code FROM mod_submenu WHERE url='%s'", mysql_real_escape_string($url));
getModule();
?>
<div id="collage"><img src="assets/images/img-collage.gif" height="56" width="700" alt="Our Mission Is Your Hope"></div>
<div id="body" style="clear: both; margin-top: 2px;">
<div id="rail">
<div class="h5"><h5>Donate Volunteer</h5></div>
<p>Your support is always appreciated. Please call:<br /><br />(850) 933-1449<br /><br /><a href="">Donate Volunteer Form</a></p>
<div class="h5"><h5>GSN Missions</h5></div>
<p>The Good Samaritan Network is a faith-based outreach.<br /><br /><a href="/missions/chelseas-house">Chelsea's House</a></p>
<div class="h5"><h5>Local Missions</h5></div>
<p>These missions are here in support of the homeless of Tallahassee.<br /><br /><a href="/missions/haven-of-rest">Haven of Rest</a><br /><br /><a href="/missions/care-tallahassee">Care Tallahassee</a></p>
<div class="h5"><h5>Supporters</h5></div>
<p>These organizations have generously contributed.<br /><br /><a href="/supporters">GSN Supporters</a></p>
</div>
<div id="content">
<h1>Good Samaritan Network</h1>
<p id="description">Homeless women and children in our area face many problems and are in need of help. It is the mission of the Good Samaritan Network to be a part of the solution to this ever-growing problem. Through various support services, we are able to meet the needs of the homeless; thus, offering them encouragement and hope in God. The Good Samaritan Network is a faith-based outreach who networks with like-minded agencies and ministries for the purpose of restoration to individuals who find themselves facing homelessness. It is our goal to reach out to their physical, emotional, and spiritual needs.</p>
<h2>Events</h2>
<h3 class="event">Chelsea's House Christmas Benefit Dinner</h3>
<ul class="event-list">
<li>6:00 pm, Tuesday, December 2nd, 2008</li>
<li>Reservation Required</li>
<li>Call: (850) 933-1449</li>
</ul>
<h2>Donate</h2>
<h3>Donation Options</h3>
<ol>
<li><a href="">Donate Online</a></li>
<li>Email <a href="mailto:
bethburns@gsncares.org">
bethburns@gsncares.org</a> for more information</li>
<li>Mail to: GSN, P.O. Box 10527, Tallahassee, Florida 32301</li>
</ol>
<p class="bold">* Your tax deductible gift may now be made directly to GSN, which is 501c3 pending.</p>
</div>
</div>
<div id="footer">
<ul id="footer-menu">
<li><a href="/">gsncares.org</a> | </li><li><a href="/missions">Missions</a> | </li><li><a href="/programs">Programs</a> | </li><li><a href="/events">Events</a> | </li><li><a href="/help">How to Help</a> | </li><li><a href="/press">Press Releases</a> | </li><li><a href="/contact">Contact</a></li>
</ul>
<br /><div>Copyright © 2008 - 2009 Good Samaritan Network, Inc.</div>
</div>
</body></html>