Welcome Guest, Not a member yet? Register   Sign In
How do I echo datase id in base url? CI4?
#2

On your edit page you will need the information of that specific user. User id, or using ids will always be the best option for you.

PHP Code:
<td><a href="<?php echo base_url('/dashboard/fetch_single_data').'/'.$member['id'];?>" class = "btn btn-primary">Edit</a></td>
<
td><a href="<?php echo base_url('/YourController/delete_single_user').'/'.$member['id'];?>" class = "btn btn-primary">Delete</a></td

Now on your url  for the edit page you will have the user id in one of the url segments.

In your controller:

PHP Code:
$user_id $this->request->uri->getSegment(2); // or 3 or 4 on which uri segment your id is 

then find the user details according to this id, and send them to the edit_user page as usual.
Reply


Messages In This Thread
RE: How do I echo datase id in base url? CI4? - by demyr - 03-29-2021, 09:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB