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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:42:31+00:00 2026-06-17T17:42:31+00:00

A database table for Event model has following fields: user_id, name, title in the

  • 0

A database table for Event model has following fields:

user_id, name, title

in the Event add view the user is asked to insert the name, hours and minutes as following:

    echo $this->Form->input('hours');
    echo $this->Form->input('minutes');
    echo $this->Form->input('name');

Now the name would be obviously stored as it should, but the problem occurs when I want to concacinate the hours and minutes inserted by user and store them into the DBs “title” field.

Any suggestions for how to achieve this?

  • 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-17T17:42:33+00:00Added an answer on June 17, 2026 at 5:42 pm

    use the model’s beforeSave function to add any fields you like. In this case a title is being injected

    in Event.php

    public function beforeSave($options=array()){
      parent::beforeSave($options);
      $this->data['Event']['title'] = $this->data['Event']['hours'].$this->data['Event']['minutes'];
      //do other stuff
      return true;
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using http://keith-wood.name/countdown.html . Each 'Event' table in my database has a 'date' column.
I have a database table of events. Each event has a category and a
I've got my table called Device_tbl which has the following columns: Image Manufacturer Model
The database table only contains the four fields that the query is attempting to
In database table I have column called options . It has type of integer
I am creating a database table with the following sql: CREATE TABLE `cs3_ds1` (
I use auto generated Entity-Framework Data Model for a Database that has 100+ tables.
I have a question regarding default values for model fields, this problem has been
I have a table in my postgresql 8.4 database like this: id(serial), event_type_id(id, foreign
My database table have a Timestamp column named as inTime and i am using

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.