Concurrency Problem? - update together in the same time

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Concurrency Problem? - update together in the same time

.hack//GU
I have a problem in PHP.
When more than one client update something in database, they won't work.

so, how do I make out for it?

example:
at the same time, in real-time chatboard, 2 persons click CHAT, what can I do so that both of them actually chat?
or at bidding website, when 2 persons bid at same time, how could I do that?

thanks for answer.

Reply

urtrivedi
Actually You can build Transactions before update or inserting data into database. also don't work with out proper primary and foreign keys in you tables.
Try to use autogenerate option for primary keys.

I suppose you are using mysql database,
I dont know about mysql transactions, but I use oracle 10g.

If I have to execute set of 2 query in the manner that 2 should succeed or no query should execute.
CODE
$query1="some insert";

$statement1 = oci_parse($connection, $query1);
if ((oci_execute($statement1,OCI_DEFAULT)))
{

[indent]     $query2="some more insert";
     $statement2 = oci_parse($connection, $query2);
     if ((oci_execute($statement2,OCI_DEFAULT)))
    [indent]           oci_commit($connection));   [/indent]
    
     else
[indent]              oci_rollback($connection));  [/indent]
[/indent]
}
else
{
              oci_rollback($connection))  ;
}


You please specify what problem exactly you are facing. Why you feel that you data is not concurrent.

Notice from rvalkass:

Code needs to go inside Code BBTags.
List of BBCodes

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. php mysql concurrency - 167.62 hr back. (1)
  2. concurrency problém - 303.34 hr back. (1)
  3. two connections the same time mysql php game - 306.41 hr back. (2)
  4. php mysql update concurrent - 443.14 hr back. (1)
  5. concurrency problem - 195.48 hr back. (4)
  6. php concurrency problems - 474.71 hr back. (1)
  7. how to insert two record at the same time in mysql - 533.22 hr back. (1)
  8. updating a mysql record at the same time - 538.11 hr back. (1)
  9. update two table at the same time - 544.46 hr back. (1)
  10. inserting and updating together in mysql php - 546.74 hr back. (1)
  11. inserting and updating two tables at a time by mysql queries - 547.43 hr back. (2)
  12. mysql two people update at the same time - 572.11 hr back. (1)
  13. "php" problem concurrency - 612.23 hr back. (1)
  14. how to insert and update records at the same time in oracle forms? - 631.47 hr back. (1)
Similar Topics

Keywords : concurrency, problem, update, time

  1. Sending E-mails After News Update?
    Coding needed?!? (8)
  2. Mysql Won't Update
    (4)
    Ok, so I'm making some arcade administration software so I don't have to add games the hard
    way, well anyway, one of the features I have is that on the homepage is a featured author and as
    such I just have it so it updates one line in the mySQL. Well, the page with the form passes on the
    varibles fine and the updating page recieves them because I echoed everything, then I build the
    query and I even echo the query and it comes out exactly how I want it to, but for some reason, the
    database itself won't update even though all the varibles are there. Here's....
  3. Php Update
    (4)
    Hey guys, I'm currently making my own online PHP game, and I'm smack into the middle of the
    coding. The game is an industry/economy type game where you start out with some initial resources
    and a building and you expand your business empire by building more buildings that produce more
    buildings, which can be bought and sold on the live market. Basically, you try and become the
    wealthiest player in the game by the time the round ends. My problem is, I need my game to update
    hourly and not hourly. Meaning, I have codes that update my MySQL database when a user bu....
  4. Mysql Update Everything
    Bit confusing (4)
    i need to make a script that will take a number from every record in a mysql table, takeaway 1 from
    them all then replace them all in the right places. so if it looked like Record 1 5 Record 2 8
    Record 3 9 then i exectue the script then it turns into: Record 1 4 Record 2 7 Record 3 8 i
    cant think of a way to do this so if you can help id be very greatful. Thanks in advance Andre....

    1. Looking for concurrency, problem, update, time

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for concurrency, problem, update, time

*MORE FROM TRAP17.COM*
advertisement



Concurrency Problem? - update together in the same time



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE