Hi,
Suppose u want to update one row and its id is 1
then u want
following array

$this->data['ModdelName']['id']=1;
$this->data['ModdelName']['2field']='value';

$this->ModelName->save($this->data);


Array
(
    [ModelName] => Array
        (
            [id] => 1
            [2field] => 'value'
        )
)




On Thu, May 13, 2010 at 3:52 PM, Narendra Padala <[email protected]>wrote:

>
>  Sir, looked at sir, but i am not getting properly, can u write one example
> for my above code..please help me out sir
>
> On Thu, May 13, 2010 at 3:31 PM, Jeremy Burns <[email protected]> wrote:
>
>> Have you even looked at the online guide?
>> http://book.cakephp.org/view/1031/Saving-Your-Data
>>
>> Jeremy Burns
>> [email protected]
>>
>>
>> On 13 May 2010, at 11:00, Narendra Padala wrote:
>>
>> >
>> > Hi...All!,
>> >
>> > I am new to cake php,I am suing postgreSql i need to update some
>> > fields in my database. In my controller my code like this....here i
>> > need convert these update command to cake, Please anyone can help me
>> > out how to convert this in to cake.
>> >
>> >
>> > function fun() {
>> >
>> > /**********************************
>> > ( 1 )**********************************************/
>> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD could not be
>> > mounted. Make sure it is a valid $COMPANY_NAME Data CD.' WHERE
>> > lngcdlog = $lngCDLog");
>> >
>> >
>> > /*************** Here some content related to our script
>> > *****************/
>> > $fError = fopen("/tmp/errorlog", "a+");
>> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
>> > \n\n");
>> > fclose($fError);
>> >
>> > /
>> >
>> ************************************(2)********************************************/
>> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'There is not
>> > sufficient space on your hard drive.' WHERE lngcdlog = $lngCDLog");
>> >
>> > /*************** Here some content related to our script
>> > *****************/
>> > $fError = fopen("/tmp/errorlog", "a+");
>> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
>> > \n\n");
>> > fclose($fError);
>> >
>> > /
>> >
>> **************************************(3)******************************************/
>> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'There is not
>> > sufficient space on your hard drive.' WHERE lngcdlog = $lngCDLog");
>> >
>> > /*************** Here some content related to our script
>> > *****************/
>> > $fError = fopen("/tmp/errorlog", "a+");
>> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
>> > \n\n");
>> > fclose($fError);
>> >
>> > /
>> >
>> **************************************(4)******************************************/
>> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD is not a
>> > valid $COMPANY_NAME data CD.' WHERE lngcdlog = $lngCDLog");
>> >
>> > /*************** Here some content related to our script
>> > *****************/
>> > $fError = fopen("/tmp/errorlog", "a+");
>> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
>> > \n\n");
>> > fclose($fError);
>> >
>> > /
>> >
>> **************************************(5)******************************************/
>> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD may not be
>> > loaded in this $DEST_NAME.' WHERE lngcdlog = $lngCDLog");
>> >
>> > /*************** Here some content related to our script
>> > *****************/
>> > $fError = fopen("/tmp/errorlog", "a+");
>> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
>> > \n\n");
>> > fclose($fError);
>> >
>> > /
>> >
>> **************************************(6)******************************************/
>> > pg_exec($conn,"UPDATE tblcdlog SET strcdno = '$identifiercode' WHERE
>> > lngcdlog = $lngCDLog");
>> >
>> > /*************** Here some content related to our script
>> > *****************/
>> > $fError = fopen("/tmp/errorlog", "a+");
>> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
>> > \n\n");
>> > fclose($fError);
>> >
>> > /
>> >
>> **************************************(7)******************************************/
>> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'Invalid
>> > $COMPANY_NAME CD-Rom ID Code.' WHERE lngcdlog = $lngCDLog");
>> >
>> > /*************** Here some content related to our script
>> > *****************/
>> > $fError = fopen("/tmp/errorlog", "a+");
>> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
>> > \n\n");
>> > fclose($fError);
>> >
>> > /
>> >
>> **************************************(8)******************************************/
>> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD has already
>> > been loaded, and may not be loaded again.' WHERE lngcdlog =
>> > $lngCDLog");
>> >
>> > /*************** Here some content related to our script
>> > *****************/
>> > $fError = fopen("/tmp/errorlog", "a+");
>> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
>> > \n\n");
>> > fclose($fError);
>> >
>> > /
>> >
>> **************************************(9)******************************************/
>> > pg_exec($conn,"UPDATE tblcdlog SET blnsuccess = '1', strversion =
>> > '$strVersion', strupdateno = '$strUpdateNo' WHERE lngcdlog =
>> > $lngCDLog");
>> >
>> > }
>> >
>> >
>> >
>> > Please help me out ....Thanks in Advance..!
>> >
>> >
>> >
>> > Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>> >
>> > You received this message because you are subscribed to the Google
>> Groups "CakePHP" group.
>> > To post to this group, send email to [email protected]
>> > To unsubscribe from this group, send email to
>> > [email protected]<cake-php%[email protected]>For
>> >  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]<cake-php%[email protected]>For
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Dilip Godhani
Jr Software Developer, Entourage Solutions
e-mail: [email protected]
          [email protected]
Web.: www.entouragesolutions.com
m. 9913822582

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to