Welcome Guest, Not a member yet? Register   Sign In
function() + mysql problem
#1

[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>
&lt;input type="checkbox" name="chkName"&gt;
</td>
<td>
&lt;?= users($row->sent_id); ?&gt;
</td>
<td>
&lt;?= $row->subject; ?&gt;
</td>
<td>
&lt;?= $row->date; ?&gt;
</td>
</tr>
&lt;?
$x++;
}
}
?&gt;


users($row->sent_id); dont work ... not connected to database Sad what is the problem?

when: return "xy"; work... but i have database select error


please help me.


Messages In This Thread
function() + mysql problem - by El Forum - 09-16-2010, 05:21 AM
function() + mysql problem - by El Forum - 09-16-2010, 08:08 AM
function() + mysql problem - by El Forum - 09-16-2010, 08:16 AM
function() + mysql problem - by El Forum - 09-16-2010, 10:25 AM
function() + mysql problem - by El Forum - 09-16-2010, 11:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB