没有数据库保存数据? [关闭]

I'm writing a PHP/HTML app that I want to compile to a windows app with no need for a browser (with ExeOutput for example).

Well, my dad works in prison, so he has internet connection but he can't access to a lot of sites because the browser does not allow him to (again, I am saying what he tells me, I don't know how if they "don't allow him"). So he asked to make this app portable.

The thing is... it is an app that it should save everything he does. It has a total hours, and it has inputs with the hours he does every day, and it displays a "dot" on a calendar on the days he has added some hours, plus those hours has to be subtracted from the total.

It will have a button to "save" and next time he accesses the app, all the hours he has changed last time, are loaded again.

Does this make any sense?

Well, at work, I work on the server, so I would create a table to save that data, but because it is not anything from work, once I've finished I can't use this server any more.

My question is whether there is any way I can save data without a database? Because I guess he won't have a database on his computer :S

Everything is still very abstract for me referring to programming, so maybe anything of what I've just said has sense.

I have read another post around here talking about Sails.js, but when I look the information it is not clear if it is what I am looking for. If anyone has an idea about what I am trying to achieve.... I would appreciate any help!

Hmm., can't have the cake and eat it too, PHP cannot be converted into an exe. A close alternative, will be XAMPP, if he is allowed to install it in prison, the data will be local, you could develop in PHP and deploy it to his XAMPP folder. SQLite is ideal for small portable data keeping.

Python is super for this kind of thing, and you can convert it into a pretty portable application using Py2Exe. You can do the development at your end, choose to store data in say, JSON or XML or any other flat file database or portable database such as SQLite. I had a quick learning of Python for a similar simple app I wanted, and with the use of pre-built libraries for most common tasks, I found the experience good, as a beginner.

Plus 1, for a son who develops an app for a Dad, love you for that. :-)

Not the best way, but it's possible to use flatfile database.

https://en.wikipedia.org/wiki/Flat_file_database

Once again: it's not the best way, it might even be a really bad way, but it's possible.

But if it's PHP code I assume you still need PHP, even in .exe. Or will it be compiled that way?

You can still use "Portable" database , SQLite , it is a file and could be included (embedded) in the project files, you can use PDO to access SQLite as you would do the same for MySQL

You can have a look at SQLite/PHP Example http://www.if-not-true-then-false.com/2012/php-pdo-sqlite3-example/

What so ever language you use. If you want to be database free, the best thing according to me will be to use JSON files. They are very light. They can store any amount of data. Their format is readable by any language(so you dont have to worry about web interface or desktop app). And its easy to learn. It Will take you only one hour to understand it :)