⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

How change the post_array value after update?



Pakman_reload

Pakman_reload
  • profile picture
  • Member

Posted 26 October 2015 - 12:33 PM

How can I change the value of fields in post_array after update or insert a record? If I click the "update changes" button but I don't exit from edit window, and I have a call back function that rename the file uploaded, and I click again in the button the post_array has the OLD name of the file and the script fails!!

 


Paul Savostin

Paul Savostin
  • profile picture
  • Member

Posted 27 October 2015 - 01:10 AM

Not sure if I understand u correctly. Can u explain in more details what u want to achieve?


Pakman_reload

Pakman_reload
  • profile picture
  • Member

Posted 27 October 2015 - 08:38 AM

Hello Paul! if I click in button "update changes", when editing a record, and I uploaded a file that have a callback function that rename it and update the database with new name too, when click again in "update changes" button the $post_array have the orignal name and overwrite the database.


Paul Savostin

Paul Savostin
  • profile picture
  • Member

Posted 27 October 2015 - 15:18 PM

So in post array u have new filename that ovverides old one, so what unusual in it?


Pakman_reload

Pakman_reload
  • profile picture
  • Member

Posted 27 October 2015 - 17:02 PM

Ok, the problem is that the callback function is "after" insert/update because I need the primary_key, in this callback function I rename the file and update the database but if I click again in the button the post_array have the original name of the file and if I try to rename the file not exists and the database is update with the orignal name. Sorry but I don't speak english very well


Paul Savostin

Paul Savostin
  • profile picture
  • Member

Posted 28 October 2015 - 15:03 PM

How i know after inserting row u have all fields empty like u trying inserting new row and push add button. In this situation u dont have any data in post_array i guess

When u did that in after update u can just refresh page after all logic and u will have already updated data!