Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What approach could You suggest, If I don't have mysql or other database support on webhost, but I need to store data ( textual information ) for website somewhere. It's informative site for school - approx 20 to 50 visitors per day, 6 to 7 categories with 3 to 5 subcategories. Would xml files be normal ?

share|improve this question
    
A database would be normal, xml files would be doable. –  Ben Jul 21 '11 at 17:49
add comment

3 Answers

up vote 0 down vote accepted

XML would be perfectly fine, especially with the amount of data I'm supposing you are going to be getting/generating, a csv type list with a parser of some sort (jscript, ajax, php) that could handle it would also be acceptable.

I would also contact your webhost to find out what they have for PHP support, because if they do it should have SQLite built in if nothing else. If your webhost has no dynamic languages allowed (PHP etc) I would just suggest scrapping them and finding another that supports what you need in the first place.

share|improve this answer
    
I cant move to other webhost! –  wolf3d Jul 21 '11 at 18:11
    
Since you're using codeigniter, we'll assume that you have PHP then, so you should be fine with SQLite unless your host sucks more than a "lady of the evening" on a busy night. –  Jeff Langemeier Jul 21 '11 at 18:15
1  
@wolf3d, in case you haven't looked into SQLite because it sounds too much like a database with a server component, it's not. It stores data in files, but lets you access it in nice SQLy ways, instead of having to parse XML or CSV or whatever... –  grossvogel Jul 21 '11 at 18:38
    
already sent msg to server admin for this information about SQLite –  wolf3d Jul 21 '11 at 18:50
    
i checked phpinfo page myself, looks that there is no SQLite support at all... –  wolf3d Jul 22 '11 at 6:36
show 1 more comment

Unless your webhost did something to cripple PHP, you do have SQLite support. Thats built into PHP5. That only requires the ability to read/write to local files.

share|improve this answer
add comment

I would write the data to flat files as a JSON string. PHP has very good support for encoding and decoding arrays or objects as JSON.

XML is bloated and often difficult to work with in PHP. Save yourself a lot of time with JSON.

You could even have multiple flat files each to represent what would typically be a table in a database...

  • categories.txt
  • products.txt
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.