Jump to content

[SOLVED] SELECT not showing previous INSERT


DavidAl

Recommended Posts

Hello, I have a problem with a SELECT that *sometimes* doesn't show the row from a previous INSERT. It fails around 1 call of every 10.

 

The structure I have is the following:

 

1) HTML button: calls the javascript function insertAndList().

 

2) insertAndList(): calls the javascript function insert() which through AJAX executes a PHP that inserts a row in a MySQL databas.

 

3) inserAndList(): calls the javascript function list() which through AJAX executes a PHP that lists the table.

 

If I add a delay of 100ms between 2) and 3), the list() function fails much less often, around 1 of every 100.

 

Is there a way to force the SELECT to "refresh" the buffer or whatever it is that is showing the old number of rows? (i'm not using MySQL CACHE, as far as I know).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.