how to maintain data with respect to every user?

So all the coding ninjas out there , I have recenlty started exploring the world of Web Development ( and its just awesome , i should say ) . I am stuck at problem .

What i am doing : My HTML looks something like this

<ul data-role="listview" >
<!-- List items come here -->
</ul>

These list items are generated dynamically via an AJAX call to a PHP function ( I am thinking to use Pagination , since the data in the UL may grow ) .

Till now i am using a single User scenario ( only one user accessing the website at a time ) . The data looks ok to me .

Problem Now i am thinking to increase the user presence .Many Users login at the same time . I will encounter a situation like :

User A : generated an UL with the current scenario in DB (say 10 rows )

User B enters and hits a refresh to my UL and Gone ! User A will no longer have the dataset he/she was working with and now he has 12 rows ( DB Table got 2 more inserts )

Question : Do forgive me if am asking a dumb a question . How do i overcome this multi user scenario accessing same Data but not affecting other Users ?

It would very helpful if the solution given can be easily digested by a Beginner like me :-)

Edit :
Let me provide an example :

User A Logged in :
Currently i have 5 rows in DB like

  • Hamlet
  • Macbeth
  • Brutus
  • Caesar
  • William

so my UL would look something like this :

<ul data-role="listview" id="authors">
   <li>Hamlet</li>
   <li>Macbeth</li>
   <li>Brutus</li>
   <li>Caesar</li>
   <li>William</li>
</ul>

Now User B Logs in and there has been an extra insertion in the DB

  • Hamlet
  • Macbeth
  • Brutus
  • Caesar
  • William
  • Antonio

so my UL should look (only for User B , not for User A )

<ul data-role="listview" id="authors">
   <li>Hamlet</li>
   <li>Macbeth</li>
   <li>Brutus</li>
   <li>Caesar</li>
   <li>William</li>
   <li>Antonio</li>
</ul>


Download how.to.maintain.data.with.respect.to.every.user.zip
Direct Link


Download


Download how.to.maintain.data.with.respect.to.every.user.zip
Mediafire


Download


Download how.to.maintain.data.with.respect.to.every.user.zip
Filefactory


Download

Both comments and pings are currently closed.

Comments are closed.