[eluser]brian.89[/eluser]
hy!
I've got a problem:
.../view/message.php :
function users($srt)
{
$query = $this->db->query("select first_name,last_name from bw_users where id='".$str."'");
if ($query->num_rows() > 0)
{
$row=$query->row();
return $row->last_name . $row->first_name;
}
else
{
return "fatal error";
}
}
.....
<?
$x=0;
$query = $this->db->query("select * from bw_message where userid='".$this->session->userdata('userid')."' and label='0' order by date desc");
if ($query->num_rows() > 0)
{
foreach ($query->result() as $row)
{
?>
<tr>
<td>
<input type="checkbox" name="chkName">
</td>
<td>
<?= users($row->sent_id); ?>
</td>
<td>
<?= $row->subject; ?>
</td>
<td>
<?= $row->date; ?>
</td>
</tr>
<?
$x++;
}
}
?>
users($row->sent_id); dont work ... not connected to database
what is the problem?
when: return "xy"; work... but i have database select error
please help me.