feeling dumb - needing help |
[eluser]new_igniter[/eluser]
ok, I am very new to this: this works Code: <?php this does not work Code: <?php echo $usersRow->name; ?> can anyone help me out with what I am not thinking about? I dont want to loop through anything, just print individual items in the view.
[eluser]thurting[/eluser]
It appears $usersRow is an array containing objects that have a property $name on them. Accessing the $name property of each of these objects is done successfully within the foreach loop. Attempting to access the $name of the $usersRow will fail because the array does not contain this property - it is the objects within it that do. Perhaps you should familiarize yourself with the underlying syntax of PHP. If you expect $usersRow to return one value, you can access it through $usersRow[0] and $name using $usersRow[0]->name. You should also check out http://ellislab.com/codeigniter/user-gui...sults.html for information dealing with query results - which is what I think you are working with here. Docs available at php.net
[eluser]wiredesignz[/eluser]
Code: foreach($usersRow as $key => $row)
[eluser]John_Betong[/eluser]
[quote author="new_igniter" date="1201237184"]Thanks so much, this really helps![/quote] Try this: Code: echo '<pre>'; // purely cosmetic to add linefeed |
Welcome Guest, Not a member yet? Register Sign In |