Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP Insert Record...Need to then grab ID of new record

Explorer ,
Nov 16, 2007 Nov 16, 2007
I'm using DW's Insert Record behavior with my registration form. I'd like to be able to then grab this new ID that was just created. If I add the PHP to do this ($CustomerID = mysql_insert_id();) into the behavior code, though, it breaks the behavior inside of DW.

The code actually will work if I run it but then everytime I ever edit this Insert Record behavior I to remove the code I added so the Insert Record behavior shows up again, then make my changes, and then add the code back when I'm done. Very annoying.

I could just write my own insert statements and not use the behavior but if there's a way around this problem I'd really rather stick to using DW's tools. That's why I use DW to begin with.

Any information would be greatly appreciated. Thanks!
TOPICS
Server side applications
900
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2007 Nov 17, 2007
"Angell EYE" <webforumsuser@macromedia.com> wrote in message
news:fhm510$71i$1@forums.macromedia.com...
> I'm using DW's Insert Record behavior with my registration form. I'd like
> to
> be able to then grab this new ID that was just created. If I add the PHP
> to do
> this ($CustomerID = mysql_insert_id();) into the behavior code, though, it
> breaks the behavior inside of DW.
>
> The code actually will work if I run it but then everytime I ever edit
> this
> Insert Record behavior I to remove the code I added so the Insert Record
> behavior shows up again, then make my changes, and then add the code back
> when
> I'm done. Very annoying.
>
> I could just write my own insert statements and not use the behavior but
> if
> there's a way around this problem I'd really rather stick to using DW's
> tools.
> That's why I use DW to begin with.
>
> Any information would be greatly appreciated. Thanks!

You'd have to edit the edml file in your dreamweaver configuration and
add an updatePatterns section in
"$dreamweaver\configuration\ServerBehaviors\PHP_MySQL\UpdateRecord_main.edml"

Updating server behaviors
http://livedocs.adobe.com/dreamweaver/8/extending/16_ser82.htm
--
Joris van Lier

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 17, 2007 Nov 17, 2007
I'm not sure I understand this. Is there a way I can just get the Insert Record behavior to always add

$MM_NewRecordID = mysql_insert_id();

Just as if it was built in to begin with...???
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2007 Nov 17, 2007
"Angell EYE" <webforumsuser@macromedia.com> wrote in message
news:fhmfro$l9s$1@forums.macromedia.com...
> I'm not sure I understand this. Is there a way I can just get the Insert
> Record behavior to always add
>
> $MM_NewRecordID = mysql_insert_id();
>
> Just as if it was built in to begin with...???

Yes, edit the file
"$dreamweaver\configuration\ServerBehaviors\PHP_MySQL\InsertRecord_main.edml"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2007 Nov 17, 2007
Joris van Lier wrote:
> Yes, edit the file
> "$dreamweaver\configuration\ServerBehaviors\PHP_MySQL\InsertRecord_main.edml"

Just to clarify: $dreamweaver refers to the Dreamweaver folder in
Program Files (Windows) or Applications (Mac). The actual location
depends on your operating system and the version of Dreamweaver.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 17, 2007 Nov 17, 2007
Well, I'm running WinXP Pro so I'm currently looking in: C:\Documents and Settings\username\Application Data\Adobe\Dreamweaver 9\Configuration\ServerBehaviors\PHP_mySQL

But all I see in there is what WebAssist installs. I don't see any .edml files. I also checked in the All Users instead of just my user account folder and there isn't even a Dreamweaver folder there.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2007 Nov 17, 2007
Angell EYE wrote:
> Well, I'm running WinXP Pro so I'm currently looking in:

... the wrong place. You should be looking here:

C:\Program Files\Adobe\Adobe Dreamweaver
CS3\configuration\ServerBehaviors\PHP_MySQL

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 18, 2007 Nov 18, 2007
LATEST
"David Powers" <david@example.com> wrote in message
news:fhn0df$bpm$1@forums.macromedia.com...
> Angell EYE wrote:
>> Well, I'm running WinXP Pro so I'm currently looking in:
>
> ... the wrong place. You should be looking here:
>
> C:\Program Files\Adobe\Adobe Dreamweaver
> CS3\configuration\ServerBehaviors\PHP_MySQL

Thanks for explaining that in detail David, I sometimes forget I had to RTFM
too.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines