Jump to content

Flat File Help


invisionx

Recommended Posts

I know this is a total noob question but im just getting into flat file scripts because a friend of mine has a site that does not have a database. so i told him ill try making him a news script made with flatfile so he doesn't have to switch hosts.. but my question is..

 

is there a way to delete data thats in flatfile? like set them in an array or something?

 

please help me thank you

 

invisionx

Link to comment
https://forums.phpfreaks.com/topic/57297-flat-file-help/
Share on other sites

The trick to flat filing is using delimters to seperate data in the flat file

most common method is each new "fake mysql row" is delimitered by a \n (break line) and each field is seperated by a comma or semi colon, what ever delimtier works best in your case (it can't be used in the values).  Yes you can append it very easily if you set it up like this but you have to open the flat file find the row you wanna append append it then resave the file.

Link to comment
https://forums.phpfreaks.com/topic/57297-flat-file-help/#findComment-283229
Share on other sites

well im getting alittle what your talking about like the break and stuff

 

fputs ($out,implode,("\n")); 

 

see the part i am not understanding is append part.  ???

are you talking about going into cpanel and deleting it? because he doesn't really want to keep going in there to delete it all the time.

 

and also im not sure if im doing this right im saving the files from form as tables

so it would be inside of tables which work great but not sure if there is a different way..

 

and i read the file like

 

readfile("users/data.dat");

 

 

Link to comment
https://forums.phpfreaks.com/topic/57297-flat-file-help/#findComment-283250
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.