Hi there.

I was kinda researching on how I could store data at best (in my opinion).
I came on "CSV" files. Which looked great to use. I found out there are
two functions that can operate file. So I keep Googling on how to use
the syntax and how all this crap works. But I couldn't understand jack
although PHP is relatievely easy and I have worked with it. I know SQL
which will be much more easier to me to manage the data, plus, it has
some additional functions.

So I was wondering if there is a file that I could include (); and I
would be able to use SQL syntax on the CSV file and receive real working

Recommended Answers

All 3 Replies

I don't know if there is anything in PHP, but there is a tool written in Python:

Otherwise you can check the SQLite library, it's used with sqlite files:

But files and sqlite are, generally, good to save little data, if your application will be used by multiple users and deal with many MB of data then it's better to use a relational database. In alternative take a look at NoSQL solutions:

Ok, SQLLite, seems being able to do it. But... how to protect it?
I mean, you click on it twice and whole database is in your hand.

By the way. You solved another pending question, no one was able to.

You can limit the access to the file by saving it outside the webroot, or if you cannot, by applying an .htaccess rule to limit the access to a path directory or to a specific filetype. A part this, there are some chipers for sqlite files, for example:

But you have to install and enable the module.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.