Welcome Guest, Not a member yet? Register   Sign In
Send email automatically with Code Igniter
#2

[eluser]pickupman[/eluser]
Your code is very close to working. I would recommend using the following in your model
Code:
//Change
return $this->db->get();

//To
$query = $this->db->get();
if($query->num_rows() > 0)
  return $query->result();

return FALSE;

Right now, you are only returning the query object, not a field value. The corrected code will return the result object or FALSE if query fails. I can't tell from your query strings if you might be returning multiple rows or not. You will need to iterate through the result object and process accordingly.

Code:
$getmail = $this->Send_model->get_mail();

if($getmail != FALSE)
{
   foreach($getmail as $mail)
   {
     echo $mail->email;
   }
}


Messages In This Thread
Send email automatically with Code Igniter - by El Forum - 06-01-2010, 12:35 AM
Send email automatically with Code Igniter - by El Forum - 06-01-2010, 09:44 PM
Send email automatically with Code Igniter - by El Forum - 06-02-2010, 12:59 AM
Send email automatically with Code Igniter - by El Forum - 06-02-2010, 07:22 AM
Send email automatically with Code Igniter - by El Forum - 06-02-2010, 08:46 PM
Send email automatically with Code Igniter - by El Forum - 06-02-2010, 09:01 PM
Send email automatically with Code Igniter - by El Forum - 06-02-2010, 10:20 PM
Send email automatically with Code Igniter - by El Forum - 06-03-2010, 02:35 AM
Send email automatically with Code Igniter - by El Forum - 06-09-2010, 09:14 PM
Send email automatically with Code Igniter - by El Forum - 06-10-2010, 02:06 AM
Send email automatically with Code Igniter - by El Forum - 08-09-2010, 12:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB