1

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 ?

1
  • A database would be normal, xml files would be doable. Commented Jul 21, 2011 at 17:49

4 Answers 4

0

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.

6
  • I cant move to other webhost! Commented Jul 21, 2011 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. Commented Jul 21, 2011 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... Commented Jul 21, 2011 at 18:38
  • already sent msg to server admin for this information about SQLite Commented Jul 21, 2011 at 18:50
  • i checked phpinfo page myself, looks that there is no SQLite support at all... Commented Jul 22, 2011 at 6:36
1

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.

1

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
1
  • Upvoted as the simplest solution. I added an answer with code samples Commented Jan 9, 2015 at 14:47
0

I would recommend using the Jekyll Static Site Generator. It requires Ruby to be installed on your local development machine. It uses a simple template language that gets compiled down to static HTML files you can FTP to a web server. It's what GitHub uses when you host your own documentation sites for a Git repository.

Using something like CodeIgniter without a database feels like you are hitting a thumbtack with a sledge hammer, especially if you are the one doing all the updates.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.