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

Insert & Update On same page?

LEGEND ,
Jan 19, 2007 Jan 19, 2007

Copy link to clipboard

Copied

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
TOPICS
Server side applications

Views

621
Translate

Report

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 ,
Jan 19, 2007 Jan 19, 2007

Copy link to clipboard

Copied

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

}

?>
--
Steve
steve at flyingtigerwebdesign dot com

Votes

Translate

Report

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 ,
Jan 19, 2007 Jan 19, 2007

Copy link to clipboard

Copied

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
>
> }
>
> ?>

Votes

Translate

Report

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 ,
Jan 19, 2007 Jan 19, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

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 ,
Jan 19, 2007 Jan 19, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Report

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 ,
Jan 19, 2007 Jan 19, 2007

Copy link to clipboard

Copied


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



Votes

Translate

Report

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
New Here ,
Jan 19, 2007 Jan 19, 2007

Copy link to clipboard

Copied

You can use a command statement or stored procedure for the update with the insert.
Dave

Votes

Translate

Report

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 ,
Jan 19, 2007 Jan 19, 2007

Copy link to clipboard

Copied

When I am developing in Dreamweaver, I use one Server Behavior per page.
Makes debugging and upkeep simpler.

Votes

Translate

Report

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 ,
Jan 19, 2007 Jan 19, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

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 ,
Jan 22, 2007 Jan 22, 2007

Copy link to clipboard

Copied

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
>
>
>

Votes

Translate

Report

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 ,
Jan 22, 2007 Jan 22, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

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 ,
Jan 22, 2007 Jan 22, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Report

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