on-internet
← Community

Displaying single row of sql query result in view

Stack Overflow ·

In my view I'm trying to display just once the user_username at the top of the page,and then all the messages and the message times below. I don't have a problem with the foreach($message as $row) part and that is displaying correctly. However I cannot get the Messages by <?php echo $message['user_username']; ?> to display the name of the message poster. Any help on how I can do this will be greatly appreciated. View <html> <head> <title> View Messages </title> </head> <body> Messages by <?php echo $message['user_username']; ?>: <?php foreach($message as $row){?> <?php echo $row->text;?> <br>

Comments

Sign in or sign up to comment and upvote.

No comments yet.