Maybe something wrong with custom query?
I've never used any custom query (with $this->execute($sql)) and never had
any problem with getLastInsertId.
IMO, I think you need to return the last insert id manually if you're usnig
custom query. CMIIW.
On 12/5/06, Samuel <[EMAIL PROTECTED]> wrote:
>
>
> hi all:
> in my mode process.php
> there is a function named addProcess($datas)
> and in the body I wrote:
> $sql="INSERT INTO
>
> processes(pcs_aim_id,pcs_date,pcs_content,pcs_title,pcs_duration,pcs_modified)VALUES(".$datas['selectAim'].",NOW(),'".$datas['pcsContent']."','".$datas['pcsTitle']."','".$datas['pcsDuration']."',NOW())";
> mysql_query('SET NAMES gbk;');
> $this->execute($sql);
> $pid=$this->getLastInsertID();
>
> ...
>
> problems is that $pid is empty .why?? thanks !!!
>
>
> >
>
--
Adrian Godong
[EMAIL PROTECTED]
Microsoft Student Ambassador
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---