[eluser]boltsabre[/eluser]
As per jairoh_, you have not passed the variable from your controller to your model.
One thing to consider, instead of defining $strId as a variable of your controller method show(), and then passing it to your model you can simply access it direct in your model using $this->uri->segment(2) like this:
Code:
//your model
function get_tq(){
$sql = "SELECT * FROM myDb WHERE strId = ?";
$query = $this->db->query($sql, array($this->uri->segment(2)));
return $query->result();
}
This save code, and reduced the chances of bugs. Also, I'd suggest you also do some data cleansing on your variable first, if someone changes this variable (I'm assuming it should be a int) to a string your db query will fail. If someone removes it from the url it will fail.
I personally like to check 1. that is is set, 2. that it in an int. If either fail I just throw a custom 404 error. This ensure that it has not been tampered with and can prevent any nasty SEO things from bots crawling pages that should not exist, thus reducing "duplicate content" and "low quality" pages from being indexed!!! Trust me, it can happen and hurt your rankings!
Then I also check that the result actually returned something. If it didn't I throw a 404 http response in my view and show the user a nice little "This what-ever does no seem to exist in our database, it's possible it has been deleted. Here are your options" type of message.