Why are the two first variables being left out in $x = $greet.' '.$row->sender .' '.$combined_message; - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Why are the two first variables being left out in $x = $greet.' '.$row->sender .' '.$combined_message; (/showthread.php?tid=61076) |
Why are the two first variables being left out in $x = $greet.' '.$row->sender .' '.$combined_message; - El Forum - 09-12-2014 [eluser]thefatladysingsopera[/eluser] I have the following code, Code: foreach ($query->result() as $row){ but when i Code: echo x Code: $combined_message Why are the two first variables being left out in $x = $greet.' '.$row->sender .' '.$combined_message; - El Forum - 09-12-2014 [eluser]Tim Brownlaw[/eluser] So I am guessing that you would have tried... Code: foreach ($query->result() as $row){ Which resulted in $x only displaying what was in $combined_message. So what happens if you try Code: foreach ($query->result() as $row){ If that works you would think Hmmm what is $row->sender doing, let's find out! Code: foreach ($query->result() as $row){ It's a process of examining everything... If something's not working... Pick it apart and actually see what you are getting... So what do you get when you var_dump($row->sender);? |