Jump to content

PHP include database


thebox193

Recommended Posts

I have an idea or method in which I would like to store data but i'm running into some problems.

 

Right now I'm storing all data inside one massive multi-dimensional include file. It contains data about every bit of information about a car. We went with an include file over a mysql database to avoid massive numbers of sql queries.

 

My idea is lighten the servers load and only include data about specific cars when they are needed per page.

 

In my mind I have the idea to make a folder structure that goes [make] -> [series] -> model.inc

The pages are build so that the url reflects which vehicles are being showed, aka the pages are aware of the data they would need, so php would be able to browse the folders correctly.

 

I created a function that received a series and model and would include the file. But I overlooked the simple fact that the include only stays alive for the duration of the function and won't actually include it back to the main page.

 

Any ideas where I should go from here?

Link to comment
Share on other sites

I would completely rethink your design. Filesystem lookups are going to be allot more expensive and more complicated then any database queries. Databases are built specifically to store information in a method that makes it easy to search.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.