Home » questions » Can i receipt new data(Updated) in webpage(PHP).?

Can i receipt new data(Updated) in webpage(PHP).?

2006-08-18 22:18:25, Category: Programming & Design
I use: @mysql_query("INSERT INTO tbluser VALUES ('$name','$age')"); for insert new data into table(MySQL).And i use a javascript function for retrieve data in table: function readData(data){ alert (data): } After that i use: With $name variable reveieved by $name=mysql_result($r,0,1); I received data,but not new data,it's just old data(before data that update). Can you help me? Thanks

Answers

  1. Michael T

    On 2006-08-18 23:08:31


    Maybe your javascript/mysql show results query is being executed before the mysql insert statement has been completed. You could try: after mysql insert - then show new display page results by redirecting user to a new mysql page - via javascript timed URL redirect or a meta refresh. Or, what I do, simply echo the insert statement $name & $age to the page instead of querying the new mysql entry or redirecting the user to another page.