This should work in theory, not had much practice with codeigniter AR.
This should work in theory, not had much practice with codeigniter AR. $db_photos->select( "u. *, DATE_FORMAT(p.
Uploaddate, '%d/%m/%y') as uploaddate_formatted" , FALSE); $db_photos->from('photos as p'); $this->db->join('users as u', 'u. Id = p. User_id', 'left'); include your where clauses... NOTE { Should you not be finding users, then their photo's?
} try this //Should work Provided! Configs are in this Order //$db'photos''' //$db'default''' //First Query ( Users ) $q1 = $this->db->get_where('users', array('id'=>$id)); //Second Query (photos) $db_photos = $this->load->database('photos', TRUE); $q2 = $db_photos->select("DATE_FORMAT(uploaddate, '%d/%m/%y') as uploaddate_formatted", FALSE) ->from('photos') ->where('approved', (int)1); ->where('userid', $q1->row()->id) ->get(); var_dump($q1); var_dump($q2); //you job now is to build and object/array of the combined queries //I don't know enough about the outcome to make those judgments.
– Noah Goodrich Dec 29 '11 at 13:53 Not sure if codeigniter allows multiple database connections, you could try append a new set of database config rules. SO $config'default''..' is default, add something like $config'connection2''...' – Philip Dec 29 '11 at 14:12 Yeah I have already created a 2nd set of database values for my 2nd database in the config file. I just can't figure out how to either join the tables, or alternatively get the value from the the 'userid' field from the first query and then use it in a 2nd query in a 2nd function.
– Noah Goodrich Dec 29 '11 at 14:19 You won't be able to join now, You will need to do 2 queries... 1. Grab your photos timestamp + user_id from connection1, 2. Grab your users where id=user_id from connection2 – Philip Dec 29 '11 at 14:26 That's what I thought, but how do I create a variable from the result of the 1st query and then pass it to the 2nd function (where it will be used in a 2nd query)?
– Noah Goodrich Dec 29 '11 at 14:31.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.