Page 1 of 1

list from database not updating

Posted: Wed Mar 18, 2009 11:58 am
by kendopt
hi!
I'm trying to make a simpler version of another post I made.

I'm building a page which lists the fields of a table in a MYSQL database.
On the same page I have a form to add new fields and to edit the ones listed.
My problem is that when I add a new field the list doesn't update.

I wonder if its some kind of the browser's chace that keeps it the same, or maybe reloading the page is faster than the MYSQL insert and thats why it only updates the list after closing and opening the page back.

Does anyone know anything about it?

Re: list from database not updating

Posted: Wed Mar 18, 2009 12:14 pm
by William
I would have to see your code but my guess is you're doing a SELECT statement BEFORE the INSERT so the data you're displaying is stale. Please post your code if this isn't the case.

Re: list from database not updating

Posted: Wed Mar 18, 2009 1:53 pm
by kendopt
The SELECT was before the INSERT.

I changed the order and now works fine.

makes sense ... lol
(it's what being noob is all about)

Thanks for your help

Re: list from database not updating

Posted: Wed Mar 18, 2009 1:54 pm
by William
kendopt wrote:The SELECT was before the INSERT.

I changed the order and now works fine.

makes sense ... lol
(it's what being noob is all about)

Thanks for your help
No problem! :-)

Re: list from database not updating

Posted: Wed Mar 18, 2009 1:59 pm
by php_east
look ma, no codes ! :drunk: