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 7574961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:34:00+00:00 2026-05-30T16:34:00+00:00

this is action url: http://localhost/carsdirectory/users/dashboard . dashboad.ctp (i have select filed and in this

  • 0

this is action url: http://localhost/carsdirectory/users/dashboard.

dashboad.ctp (i have select filed and in this select field i m fetching data from that filed car_type and table name car_types)

<?php echo $this->Form->create('User', array('type' => 'file', 'action' => 'dashboard')); ?>

     <label class="ls-details-label">Type</label>
    <div class="ls-details-box">
        <?php 
            foreach ($car_types as $car_type)
            {
                $car_type_new[$car_type['Car_type']['id']]=
                                        $car_type['Car_type']['car_type'];
            }
            echo $this->Form->input('car_type',
                                    array(  'label'=>false,
                                            'options'=>$car_type_new,
                                            'empty'=>' Select ',
                                            'class'=>'styledselect_form_1'));
        ?>
    </div>
<?php echo $this->Form->end(array('label' => 'Submit', 
                                    'name' => 'Submit',     
                                    'div' => array('class' => 'ls-submit')));?>

users_controller.php (controller)

class UsersController extends AppController{

   var $name = "Users";

   public function dashboard(){

      $this->loadModel('Car_type'); // your Model name => Car_type      
      $this->set('car_types', $this->Car_type->find('all'));

         if(!empty($this->data))
       {

        $this->loadModel('Car');

        if($this->Car->save($this->data))
        {
          $this->Session->setFlash('Detail has Been Saved');

          $this->redirect(array('action'=>'dashboard'));

        }
        else
        {
            $this->Session->setFlash('Detail could not save'); 

        }

    }

}

car.php (model)

<?php
class Car extends appModel{
  var $name = "Car";
}
?>

i want to inset data car_type_id field in (table name cars) , but i m not able to do it

so plz help me

thanks in advance, vikas tyagi

  • 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-05-30T16:34:02+00:00Added an answer on May 30, 2026 at 4:34 pm

    You may try this:

    echo $this->Form->input('Car.car_type_id', array(...));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is action url http://localhost/carsdirectory/cars/home cars_controller.php(controller) public function home(){ $this->set('latest_cars', $this->Car->find('all', array( 'order' =>
i have this url http://localhost:17643/category/1/Home/Arts/ It shoud redirect to home/index?idCategory=1 Instead i get a
I am making a url like this url = new URL(http,localhost,9080,/path/to/my/resource/myAction.action); instead of making
I'm new to cakephp...and I have a page with a url this: http://localhost/books/filteredByAuthor/John-Doe so
I have a question about Url.Action. My position is on http://localhost/User/Edit and for some
I have the following URl: http://localhost:12981/BaseEvent/EventOverview/12?type=Film This is route: routes.MapRoute( Default, // Route name
Is this possible? I'd like to expose a URL (action) such as http://mysever/myapp/UpdateHeartbeat/ .
I have an URL like this /home/action/id How can I access this id in
I'm sure I have seen this syntax <%= Url.Action((MyController c) => c.MyMethod(a)) %> or
In this example, <%=button_to_remote Get Related Users, {:url => { :action => 'get_related_users' },

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.