I want to pass a license key in where condition of my sql.
I fetch my keys like this
$this->data['keys'] = $this->key_m->get_key();
<?php if(count($keys)): foreach($keys as $key): ?>
<tr >
<td><?php echo anchor('admin/activation/'.$key->id, $key->site_key); ?></td>
Now i am using anchor tag here. I want to do something like this:
I have a table called activation which contains the device_id and the key with which it is activated.
I get all the keys shown up here, where i will have key, company name and num_licenses.
Now when i click on the key, i want to fetch all the devices that are activated using that key.
I hope you understood me
If you are asking how to use the link(s) you are generating in your question then this might be the answer.
Assuming the results of anchor are something like this
http://example.com/admin/activation/123
Then (assuming there is no special routing in place) this is what would recieve that link
class Admin extends CI_Controller
{
public function activation($key)
{
//use $key argument here, which in this example is equal to 123
}
}