On Thu, Jul 1, 2010 at 1:57 PM, Andrei Mita andrei.m...@gmail.com wrote:
I am unbelievably stupid some times. I have lost two days trying to figure
this one out and it never crossed my mind to check the validation rules in
the model. And everything was right there in the manual: If for some
Hello,
I have tried many different ways to update a record in one table with no
luck. In one simple function I have 2 save(update) queries. The first one is
always skipped.
This is the one:
$game_final = array(
'id' = $this-Session-read('Game.game_id'),
'scored' = $scored,
'conceded' =
If you have id, you do not need to use create ()
2010/7/1 Andrei Mita andrei.m...@gmail.com
Hello,
I have tried many different ways to update a record in one table with no
luck. In one simple function I have 2 save(update) queries. The first one is
always skipped.
This is the one:
I've tried without create, no result.
On Thu, Jul 1, 2010 at 6:40 PM, Edinei L. Cipriani phpedi...@gmail.comwrote:
If you have id, you do not need to use create ()
2010/7/1 Andrei Mita andrei.m...@gmail.com
Hello,
I have tried many different ways to update a record in one table with no
Try:
$game_final['Game'] = array(
'id' = $this-Session-read('Game.game_id'),
'scored' = $scored,
'conceded' = $conceded,
'correct_answers' = $correct_answers,
'wrong_answers' = $wrong_answers,
'time_end' = date('Y-m-d H:i:s'),
'outcome' = $game_outcome);
$this-Game-save($game_final);
Em 01/07/10
No luck. I don't get it. No errors, nothing. It's as if the query isn't
there. The only thing I get from sql dump is:
SELECT COUNT(*) AS `count` FROM `games` AS `Game` WHERE `Game`.`id` = 1
SELECT COUNT(*) AS `count` FROM `games` AS `Game` WHERE `Game`.`id` = 1
On Thu, Jul 1, 2010 at 7:12 PM,
Em 01/07/10 13:24, Andrei Mita escreveu:
No luck. I don't get it. No errors, nothing. It's as if the query
isn't there. The only thing I get from sql dump is:
Try:
pr($game_final);
die();
It seems to me that they are accessing the correct action
Check out the new CakePHP Questions site
Where should I try that? View, controller?
On Thu, Jul 1, 2010 at 7:33 PM, Edinei L. Cipriani phpedi...@gmail.comwrote:
Em 01/07/10 13:24, Andrei Mita escreveu:
No luck. I don't get it. No errors, nothing. It's as if the query isn't
there. The only thing I get from sql dump is:
Try:
Em 01/07/10 13:39, Andrei Mita escreveu:
Where should I try that? View, controller?
Controller.
On Thu, Jul 1, 2010 at 7:33 PM, Edinei L. Cipriani
phpedi...@gmail.com mailto:phpedi...@gmail.com wrote:
Em 01/07/10 13:24, Andrei Mita escreveu:
No luck. I don't get it. No errors,
I believe it's OK
Array
(
[Game] = Array
(
[id] = 2
[scored] = 0
[conceded] = 6
[correct_answers] = 0
[wrong_answers] = 30
[time_end] = 2010-07-01 19:47:49
[outcome] = -1
)
)
On Thu, Jul 1,
I am unbelievably stupid some times. I have lost two days trying to figure
this one out and it never crossed my mind to check the validation rules in
the model. And everything was right there in the manual: If for some reason
your data isn't saving, be sure to check to see if some validation rules
Em 01/07/10 13:57, Andrei Mita escreveu:
I am unbelievably stupid some times. I have lost two days trying to
figure this one out and it never crossed my mind to check the
validation rules in the model. And everything was right there in the
manual: If for some reason your data isn't saving, be
The action is the above one and the model(with validation rules deleted):
?php
class Game extends AppModel {
var $name = 'Game';
var $belongsTo = array(
'Stage' = array(
'className' = 'Stage',
'foreignKey' = 'stage_id',
),
'User' = array(
try to do an insert with the data you are testing directly into your
database, so I noticed you need the user_id and stage_id
2010/7/1 Andrei Mita andrei.m...@gmail.com
The action is the above one and the model(with validation rules deleted):
?php
class Game extends AppModel {
var
It is solved. When I created my table I defined outcome as tinyint and when
baked, cake made a validation rule to be boolean. I then realized I need at
least 3 values for that field and changed it to float. When trying to update
the record with -1 the validation rule was broken and no update was
15 matches
Mail list logo