Welcome Guest, Not a member yet? Register   Sign In
one query's multiple results into new query? :S
#3

[eluser]Maiden13[/eluser]
Would this be better? Im not sure if im adding the var($w) correctly im getting an errors saying it could not be converted to string, so im guessing its meant to be done another way? or am I still dealing with an object?

Thank in advance.

Code:
function check() {

$e = "SELECT msgto_message FROM msgto WHERE msgto_display = 'y' AND msgto_recipient = '1'";
        
$w = $this->db->query($e);

$sql = "SELECT msg_content FROM msg WHERE msg_id = '$w'";
$q = $this->db->query($sql);
        
if($q->num_rows() > 0) {
    foreach ($q->result() as $row) {
        $data[] = $row;
    }
    return $data;
}

}


Messages In This Thread
one query's multiple results into new query? :S - by El Forum - 12-07-2010, 09:55 PM
one query's multiple results into new query? :S - by El Forum - 12-08-2010, 02:57 AM
one query's multiple results into new query? :S - by El Forum - 12-08-2010, 03:15 AM
one query's multiple results into new query? :S - by El Forum - 12-08-2010, 03:24 AM
one query's multiple results into new query? :S - by El Forum - 12-08-2010, 11:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB