472,791 Members | 1,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 software developers and data experts.

data access btw: Merry Christmas!

Merry Christmas!

I'm looking at doing a web application using xml/xhtml/xforms and php. I think the data files will not be huge so i don't want to use MySQL database, I'll just append the data to the appropriate xml files.

My question is, suppose I have a form that submits and appends the results to an xml file via php. What if several people are doing the form at the same time and several submit at the same time (think of students taking an online exam). Will php automatically handle that? I'm assuming that there is no such thing as simultaneous submissions, as there should be at least milliseconds of difference between each submission. Will php take them one at a time without overwriting or freezing up or something?
Dec 24 '06 #1
2 1345
ronverdonk
4,258 Expert 4TB
You will need to lock the file before using it. The flock() provides that function, HOWEVER, only if ALL file accessing functions for that file use flock(). Also, there are exceptions to the usage of flock(). Best is to see the PHP documentation for an explanation and some samples on locking, at http://nl3.php.net/manual/en/function.flock.php

Ronald :cool:
Dec 24 '06 #2
Thanks Ronald
Your reference helped me to clarify my question.

I won't be using several different files or functions to access a single file to append to.

Let's say I have several students accessing one form, test.xhtml (with xforms). After answering all the questions they'll submit via post to accept_answers.php. Then accept_answers.php will accept the data; open answers.xml; append the data to answers.xml; close answers.xml, and then move on to the next request.

In this situation will the http protocol (server) automatically line the users up and let them wait while it processes one submission at a time, or would even this situation still produce some kind of conflict?
Dec 27 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: T. Wintershoven | last post by:
Hello, Although i write programs in VB for a while now, i've allways used the datacontrol and MS-Access DBs for data storage and never (and i mean never) used SQL. I lookt in many sample...
14
by: Brian | last post by:
I have been using lcc-win32 but need to switch over to intel for SIMD/SSE2 stuff. The documentation is pretty limited. It does not say much about the linker other than the fact that you can create...
1
by: Alex Hardin | last post by:
Hey, I'm trying to use the connect to database wizard to connect to a MySQL database on my web server, 66.235.193.45 (I'm actually not sure if that points specifically to my part of the server, if...
5
by: manuhack | last post by:
I've written a program in Python to get some data from a website. The data structure is as follows. Every day there are new data. For each day, there are many stocks. For each stock, there are...
14
by: Susan Rice | last post by:
I want to create a readonly array of data, then a readonly array of a structure. This is data I access but I want it protected against accidental change. The following is my test code. #include...
1
by: GinaYi | last post by:
The year is drawing to an end and we thought it would be a good idea to close it off with an end of year message, wrapping up the turbulent year almost behind us and already look in to the next a...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.