[BNM] php and persistence with (oracle) databases
Jason Bailey
j.bailey at sussex.ac.uk
Fri May 11 09:51:30 BST 2007
Hello,
I'm looking at some code which is written in PHP and inserts and updates
records in an oracle database and having a small issue with how the SQL is
being run; I think. Here's the brief explanation.
The code is basically allowing referees to upload a word/pdf/gif/other
document as a reference. Basically the referee follows a URL in an email
which includes encryption to determine the referee and the applicant.
On selecting a file from their system the referee then clicks submit and
the form posts to the same page with appropriate conditional statements
e.g. if ($action == "update"){
// insert and update. Not quite like this but you get the idea.
}
The sql is an insert query and an update query.
The insert query uploads the word/pdf document to a record in the database;
as a clob/blob type thing. (it works)
A few lines afterward there's an update query which sets the status
elsewhere to 'S' for record 'S'ubmitted.
I'm wondering if it's possible for the insert query (uploading a document
could take a while on slower connections i.e. international applicants??)
to be started and somehow not completed but the update query (status=s
-quick query) is run. This results in a status of submitted but no record
with a document.
I'm thinking that maybe the person pressing submit is getting impatient and
so is hitting the submit button a few times, waiting, then giving up. Is it
possible that the insert query is detected on subsequent submits, skipped
and the update query is run. Perhaps then the person gives up and closes
the browser. Is this a persistent connection type issue or am I completely
wrong?
Thanks
Jason
More information about the BNMlist
mailing list. Powered by Wessex Networks