need to pass email field value into variable |
[eluser]Brad K Morse[/eluser]
model function: gets email of $venue_id = id Code: function getVenueChairEmail($venue_id) { Then I want to pass the email into the variable $to, like I am trying to do below Code: $to = $this->data_model->getVenueChairEmail($venue_id); It is not passing anything into $to, tested by printing it out, empty. I imagine its not as easy as that, any help is appreciated.
[eluser]skunkbad[/eluser]
Have you tested the raw query on the database to see if it returns anything? According to your code, it looks like your query is: SELECT email from venues WHERE id = $venue_id; If you plug in a venue id and it doesn't work, then there's your problem. If it does work, then you should look at the value of $venue_id before you try to pass it to the model.
[eluser]Greg Aker[/eluser]
You need to return from the model function. try: model: Code: public function get_venue_chair_email($venue_id) Controller: Code: $to = $this->data_model->get_venue_chair_email($venue_id) -greg
[eluser]Brad K Morse[/eluser]
Thank you Greg! That did the trick, you're 2 for 2!
|
Welcome Guest, Not a member yet? Register Sign In |