list from database not updating

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kendopt
Forum Newbie
Posts: 7
Joined: Mon Mar 16, 2009 8:08 pm

list from database not updating

Post 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?
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Re: list from database not updating

Post 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.
kendopt
Forum Newbie
Posts: 7
Joined: Mon Mar 16, 2009 8:08 pm

Re: list from database not updating

Post 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
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Re: list from database not updating

Post 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! :-)
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: list from database not updating

Post by php_east »

look ma, no codes ! :drunk:
Post Reply