Jump to content


Photo

Question on fopen, fwrite..


  • Please log in to reply
3 replies to this topic

#1 mr666

mr666
  • Members
  • Pip
  • Newbie
  • 3 posts

Posted 19 May 2006 - 01:39 PM

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 :)

#2 gijs25

gijs25
  • Members
  • Pip
  • Newbie
  • 9 posts
  • LocationNetherlands

Posted 19 May 2006 - 01:48 PM

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]



#3 mr666

mr666
  • Members
  • Pip
  • Newbie
  • 3 posts

Posted 19 May 2006 - 01:54 PM

well im using flash and display the data from the xml

anyway thanks for the pointer

#4 gijs25

gijs25
  • Members
  • Pip
  • Newbie
  • 9 posts
  • LocationNetherlands

Posted 19 May 2006 - 02:46 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users