Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9128215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:27:47+00:00 2026-06-17T07:27:47+00:00

I am fetching value from table sessionapps in my cakephp application. I have index.ctp

  • 0

I am fetching value from table sessionapps in my cakephp application.

I have index.ctp file as follows

<table>
<tr><td>ID</td><td>Title</td><td>Post</td><td>Actions</td><td>Created On</td></tr>
<?php foreach ($sessionapps as $post): ?>
<tr><td><?php echo $post[Sessionapp][id];?></td>
    <td><?php echo $data->Html->link($post[Sessionapp][title],array('controller'=>'sessionapp','action'=>'view',$post[Sessionapp][id]));?></td>
    <td><?php echo $post[Sessionapp][post];?></td>
    <td><?php echo $this->Html->link('Edit Post ', array('action' => 'editarticle', $post[Sessionapp][id]));?></td>
    <td><?php echo $post[Sessionapp][created];?></td></tr>
<?php endforeach; ?>
</table>

And i have created its controller sessionapps_controller.php and added action index in it as follows

function index()
    {
               $this->set('sessionapps', $this->Sessionapp->find('all'));
    }

But it is not working and giving error

Notice (8): Use of undefined constant Sessionapp - assumed 'Sessionapp' [APP/views/sessionapps/index.ctp, line 14]

Notice (8): Use of undefined constant id - assumed 'id' [APP/views/sessionapps/index.ctp, line 14]

My array $sessionapps as follows

Array ( [0] => Array ( [Sessionapp] => Array ( [id] => 1 [title] => The title [body] => This is the post body. [postby] => [created] => 2013-01-15 11:35:13 [modified] => ) ) [1] => Array ( [Sessionapp] => Array ( [id] => 2 [title] => A title once again [body] => And the post body follows. [postby] => [created] => 2013-01-15 11:35:13 [modified] => ) ) [2] => Array ( [Sessionapp] => Array ( [id] => 3 [title] => Title strikes back [body] => This is really exciting! Not. [postby] => [created] => 2013-01-15 11:35:13 [modified] => ) ) ) 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:27:48+00:00Added an answer on June 17, 2026 at 7:27 am

    I think it should be like this.

    <?php foreach ($sessionapps as $post): ?>
    <tr><td><?php echo $post['Sessionapp']['id'];?></td>
        <td><?php echo $data->Html->link($post['Sessionapp']['title'],array('controller'=>'sessionapp','action'=>'view',$post['Sessionapp']['id']));?></td>
        <td><?php echo $post['Sessionapp']['post'];?></td>
        <td><?php echo $this->Html->link('Edit Post ', array('action' => 'editarticle', $post['Sessionapp']['id']));?></td>
        <td><?php echo $post['Sessionapp']['created'];?></td></tr>
    <?php endforeach; ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have fetching record from table named Pizza_Table . Pizza_table Schema id | pizza
Is there is any way of fetching Updated Application Preferences Value from Application Settings
I am fetching some values in a forEach clause data.forEach(function(content){ ... controller.setAttribute(value from data);
I have a strange, but definitely serious problem regarding fetching data from some Facebook
I am creating a page in which I am fetching data from table and
I have a problem fetching values from a MySQL cursor. I create a temporary
for fetching sorted value from db using hibernate, I use this NamedQuery: @NamedQuery( name
I have SQL query like SELECT *, dbo.func(@param1, a.point) as fValue FROM dbo.table AS
I have a sqlite table that has amount field with NUMERIC(10,5) value(I know data
I have a table named tbl_populations having following fields: pk_populationid,residence,value,aspect,gender,fk_tbl_states_stateid I am trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.