This topic is locked

Redirect to edit page

5/31/2022 12:35:29 AM
PHPRunner General questions
I
IKA9 author

hi everyone , im wondring if its possible after add record to B table from A form . redirect to B_edit_edit.php&editeid=$data['id']
inpopup
anyhint

thank u
regards

Sergey Kornilov admin 5/31/2022

Yes it is certainly possible. The problem is that it is not clear what exactly causes the trouble. My suggestion with tasks like this is to split it into a several smaller subtasks and this way you can easier explain what you need help with.

  1. Insert a record into another table programmatically
  2. Get an ID of the new record
  3. Build the URL of the edit page of a new record
  4. Open it in a popup

I
IKA9 author 5/31/2022

@admin

yes exactly .

1 Insert a record into another table programmatically (this is done )

2 Get an ID of the new record( i tried do db::lastid() but not sure how to call it in url )
3 Build the URL of the edit page of a new record

( i tried var popup = Runner.displayPopup( {
url: "test_table_view.php?editid1="+result["id"],
width: 700,
height: 500,
header: 'View customer'
}); )

4 task could be in pop up or normal page .

Thank you

Sergey Kornilov admin 5/31/2022

You are not saying anything about what exactly causes the trouble.

I
IKA9 author 6/1/2022

the trouble i got is how to get last table id called to link
as i get from searching i can get by database api the lastid of table . where i stuck is how to empliment it to my url
example : table_edit.php?editid1= ?( suppose to be lastid fetched from database )

Sergey Kornilov admin 6/1/2022

Getting the ID and using it in a further code are two different tasks. Again, you need to proceed step by step. Are you able to retrieve that ID or not?

Here is the a link in the manual that also comes with a complete code example: DB::LastId()