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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.