i am trying to pass an id to a controller through url but the problem is it gives me the id field null result of the edit link is like "localhost/home71/project_management/index.php/boq_account/edit?id="
$url=base_url();
echo "<td id='edit'><a href='$url project_management/index.php/boq_account/edit?id='$n->id''>Edit</a></td>";
i have tried so many ways but not getting any result.one thing to mention that my $n->id is not null it has values but its not showing on the passing id parameter.
You have too many single quotes near $n->id. Try something like this:
If you're sure you have data in
$n->id
, use PHP'surlencode()
as you're passing it to<a>
. Here's how:Try like this-
Try something as below:
Try with this,