Welcome Guest, Not a member yet? Register   Sign In
Object of class CI_DB_mysql_result could not be converted to string
#1

[eluser]vickel[/eluser]
Hallo everybody,

I'm building a shopping cart and get the above error on a certain occasion:

I have in a controller the function refresh() which contains:

$this->db->select('*');
$this->db->where('sessionID', $guestSessionID);

$data['cartNow'] = $this->db->get('ticket');

$this->load->view('cart_view', $data);

in the view I use:

<?php foreach($cartNow->result() as $row):

//get variables from tables products corresponding to the ticket
$this->db->select('*');
$this->db->from('products');
$this->db->join('ticket', 'products.prodID = ticket.prodID');
$this->db->where('ticket.prodID', $row->prodID);
$query = $this->db->get();
$row = $query->row();
?>
...
...
<?php endforeach?>


the view has a checkbox, when it is checked the item is deleted from the database, this WORKS FINE if I have 2 items and remove the first, but DOESN'T WORK if i have 2 items and remove the second.


PS.: if I use after that error the above function (refresh) again, all is OK. In the database everything is OK

thank you for any help on that


Messages In This Thread
Object of class CI_DB_mysql_result could not be converted to string - by El Forum - 08-09-2008, 07:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB