Skip to main content
Inspiring
January 19, 2007
Question

Insert & Update On same page?

  • January 19, 2007
  • 11 replies
  • 642 views
With the new version 8.0.2, is it possible to get both an insert and an
update on the same page?

I've tried it and the code seems to run into itself because the Insert
shares function names with Update.

I've tried giving them different names but this doesn't work.

Any ideas? Suggestions?

Thanks
This topic has been closed for replies.

11 replies

Inspiring
January 22, 2007
New Guy wrote:
> When I am developing in Dreamweaver, I use one Server Behavior per page.
> Makes debugging and upkeep simpler.

Putting them on separate pages is my fall-back for a solution. It's
probably the way I should have gone in the first place but back then, I
didn't understand the issue as well as I do now.

On a side note, as a general rule in programming, is it better to filter
something if it exists or if it doesn't exist? I know this is probably
an over generalization but I was just curious if there was some standard
rule that programmers go by.
Inspiring
January 22, 2007
dbboyne wrote:
> You can use a command statement or stored procedure for the update with the insert.
> Dave
>


I really have to learn this command stuff. It keeps begging for my
attention but I just don't have time.

I've tried to get an example going but with little luck; what invariably
gets me is the difference between what I am trying to do or the Data and
what the example shows.

Is there a good source for learning this? Tutorials?

Thanks
Inspiring
January 22, 2007
That's what I suspected. Thanks.

RobGT wrote:
>
> I'm pretty sure you can only have one on a page (Insert OR Update, not both)
> if using the Dreamweaver server behaviours.
> If you code it yourself, then you can do what you like.
> Cheers,
> Rob
> http://robgt.com/ [Tutorials and Extensions]
> Skype stuff: http://robgt.com/skype
> SatNav stuff: http://robgt.com/satnav
>
>
>
Inspiring
January 20, 2007
On Fri, 19 Jan 2007 11:20:40 -0600, Lee <lee_nospam_@artjunky.com>
wrote:

>I think, Dreamweaver dynamic database stuff basically stops working if
>an "UPDATE AND INSERT" are on the same page. It "kills" the dynamic
>interface of Dreamweaver to have two. Consequently, after I have placed
>two on the page, if I want to add another form element, it must be done
>manually in the code.

Sure. DW does its best but to get what I want I invariably have to
hand-code, or at least modify what DW does.
--
Steve
steve at flyingtigerwebdesign dot com
Inspiring
January 19, 2007
When I am developing in Dreamweaver, I use one Server Behavior per page.
Makes debugging and upkeep simpler.
Participant
January 19, 2007
You can use a command statement or stored procedure for the update with the insert.
Dave
Inspiring
January 19, 2007

I'm pretty sure you can only have one on a page (Insert OR Update, not both)
if using the Dreamweaver server behaviours.
If you code it yourself, then you can do what you like.
Cheers,
Rob
http://robgt.com/ [Tutorials and Extensions]
Skype stuff: http://robgt.com/skype
SatNav stuff: http://robgt.com/satnav



Inspiring
January 19, 2007
Steve wrote:
> On Fri, 19 Jan 2007 10:15:11 -0600, Lee <lee_nospam_@artjunky.com>
> wrote:
>
>> I should have said that I use ASP. I'm guessing that the concept is the
>> same though. That sounds like a good solution.
>
> I don't know ASP but the idea is the same. Good luck!

I think, Dreamweaver dynamic database stuff basically stops working if
an "UPDATE AND INSERT" are on the same page. It "kills" the dynamic
interface of Dreamweaver to have two. Consequently, after I have placed
two on the page, if I want to add another form element, it must be done
manually in the code.

I was trying to avoid this so I may have another solution to put them on
separate pages.

Anyways, if you or anyone has another idea, let me know.

Adobe people, do you have any sort of advise or answers for this? If
Dreamweaver 8.0.2 just doesn't work for this, it would be nice to know.
Inspiring
January 19, 2007
On Fri, 19 Jan 2007 10:15:11 -0600, Lee <lee_nospam_@artjunky.com>
wrote:

>I should have said that I use ASP. I'm guessing that the concept is the
>same though. That sounds like a good solution.

I don't know ASP but the idea is the same. Good luck!
--
Steve
steve at flyingtigerwebdesign dot com
Inspiring
January 19, 2007
Thanks,

I should have said that I use ASP. I'm guessing that the concept is the
same though. That sounds like a good solution.

Steve wrote:
> On Fri, 19 Jan 2007 08:26:47 -0600, Lee <lee_nospam_@artjunky.com>
> wrote:
>
>> With the new version 8.0.2, is it possible to get both an insert and an
>> update on the same page?
>>
>> I've tried it and the code seems to run into itself because the Insert
>> shares function names with Update.
>>
>> I've tried giving them different names but this doesn't work.
>
> Tried giving what different names - the forms?
>
> I use a hidden variable in each form and test for it in the $_POST
> array. The insert form (which I would call frmInsert) would have a
> hidden variable called (for example) DB_INSERT and a value of
> frmInsert. Similarly, the update form (frmUpdate) might have a hidden
> variable named DB_UPDATE with a value of frmUpdate.
>
> Then you control the flow in this way:
>
> <?php
>
> if ( isset($_POST['DB_INSERT') && $_POST['DB_INSERT'] == 'frmInsert' )
> {
>
> // your insert code here
>
> } else if ( isset($_POST['DB_UPDATE') && $_POST['DB_UPDATE'] ==
> 'frmUpdate' ) {
>
> //your update code here
>
> }
>
> ?>