Efficient way of getting info
Posted: Mon Jun 06, 2011 2:44 pm
I'm working on a little page system and I was just wondering the best way of getting the info.
I have the regular stuff in my table, id, page_name, page_body but I also have two other fields, isHome and isBlog, so if either of those are true (they're bool) I only wanna get the info from those pages.
And just to minimize my query usage I use the same query to get the page_name for navigation links.
I was thinking I could pass a variable in the URL and then set up an if statement to check if the variable is set and if it is it will execute a query to get the specific info.
But I will end up with two queries then, is there someway I could do this in just one?
'Cause right now I need one query to get the navigation info and if I then wanna get the content of the specific page I need another one. It's not a terrible slow down, just asking if there is a more efficient way...
I have the regular stuff in my table, id, page_name, page_body but I also have two other fields, isHome and isBlog, so if either of those are true (they're bool) I only wanna get the info from those pages.
And just to minimize my query usage I use the same query to get the page_name for navigation links.
I was thinking I could pass a variable in the URL and then set up an if statement to check if the variable is set and if it is it will execute a query to get the specific info.
But I will end up with two queries then, is there someway I could do this in just one?
'Cause right now I need one query to get the navigation info and if I then wanna get the content of the specific page I need another one. It's not a terrible slow down, just asking if there is a more efficient way...