Re: Getting data from MySQL
Posted: Mon Nov 29, 2010 9:16 am
You've redirected all traffic to your controller page via .htaccess?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
# Turn on URL rewriting
RewriteEngine On
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]

Just change the query to "SELECT * FROM ag_pages WHERE page_url = '{$_SERVER['REQUEST_URI']}'". If the page isn't there, the query will return false. You won't need your in_array check anymore, either.someguyhere wrote:By the way Celauran, is there a simple way to modify the existing code to load the contents of the entire row (the data for the page contents) into another array so that I don't have to make 2 DB calls?