Alternative to database in PHP?

1

I want to know if there's a way to save form data, display it, and edit it without using a database? Because whenever a software will do integration with database I stop because I do not understand database very well yet. I was thinking of doing with arrays , a position of each array for a record, and an array for each form field.

I know it's hard work, but I did not want to get into the database now, is there another option?

    
asked by anonymous 23.08.2015 / 06:43

1 answer

2

Database is simpler than you think. If you do not want to install one, use SQLite . It is used just so you do not have to be recording to files. It is critical that you use such a resource. I understand that you are trying to learn slowly but you do not have to avoid this.

Although it may seem simple, writing to files directly can bring several problems. I'll give you a basic idea but it does not take into account normal functioning. You may find it easy, but it is not.

$texto = implode(",", $array); //converte o array em um texto simples
$ok = file_put_contents("arquivo.txt", $texto); //grava
$texto = file_get_contents("arquivo.txt"); //lê
$array = explode(",", $texto); //transforma em array novamente

Obviously this is a huge simplification. If you have specific questions, please ask.

    
23.08.2015 / 11:38