Jump to content

Question on fopen, fwrite..


mr666

Recommended Posts

i have a php form (edit_info.php only for logged-in members) when submitted,

1.update mysql database (table:user_info)
2.opens a single xml file (dummy.xml) and re-writes the whole structure whenever they update their info..

That particular xml file(dummy.xml) contains all the information from a table(user_info) from the database.

my question is what if there are two or more members updating their info at the same time (in-directly attempting to update the dummy.xml file at the same time) would that be a problem? like one of the member didnt get their info updated on the xml ?

do let me know if you need to look at the codes :)
Link to comment
Share on other sites

Question:
Why do you want to use xml if you have a mysql connection?

And take a look at this:
[a href=\"http://nl2.php.net/manual/en/function.flock.php\" target=\"_blank\"]http://nl2.php.net/manual/en/function.flock.php[/a]

Link to comment
Share on other sites

another thing that you can do is look how long it takes toi create an xml file if it's about 0.00001 sec don't worry about it.

[a href=\"http://nl3.php.net/manual/en/function.microtime.php\" target=\"_blank\"]http://nl3.php.net/manual/en/function.microtime.php[/a]

create a microtime var at the beginning and the end and write it to the file then you know
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.