• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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, 10:55 PM
one query's multiple results into new query? :S - by El Forum - 12-08-2010, 03:57 AM
one query's multiple results into new query? :S - by El Forum - 12-08-2010, 04:15 AM
one query's multiple results into new query? :S - by El Forum - 12-08-2010, 04:24 AM
one query's multiple results into new query? :S - by El Forum - 12-09-2010, 12:44 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.