[eluser]sandwormusmc[/eluser]
When you did the print_r of $result, you were printing out a reference to the resulting data set of your SQL statement. This is how PHP keeps track of the data it pulled as a result of your query. Hence the "mysql_result" part of the CI_DB_mysql_result object.
What you could have done from there is something like:
Code:
while($row=mysql_fetch_row($result)){
print_r($result);
}
This would have printed out all of the resulting rows from the original query. CI does this for you with the functions "result()", "result_array()", and "result_object()".
Also, another observation ... you could have used double quotes in your first SQL call. Instead of
Code:
$this->db->query(’Select nam_first_name from NAM where nam_id = “.$var1.“‘);
, you could have used something like
Code:
$this->db->query("SELECT nam_first_name FROM NAM WHERE nam_id = $var1;");
Single quotes: doesn't parse the variables in the string; Double quotes: will automatically expand the variables.
Not sure on the performance impact, but it makes the code a bit readable.