Delete Record server behavior problem
Hi all!
I'm such a painful situation, that I can't figure out, why my
Delete
Record form don't work as supposed.
It seems all things work (also gives message "You have
successfully
deleted the article."), but the problem is
that in the MySQL (5) database real deletion doesn't
occure...
I was walking along with very nice tutorial
(www.adobe.com/devnet/dreamweaver/articles/php_blog2_11.html)
if someone has time to think about...
I have all the steps (from the tutorial) done multiple times
and
result... no real deletion, despite "successfully deleted"
text :(
with regards,
andreta
Yeah! As always - if one is doing too much over and over,
then it's too
much of trouble.
I used sample delete_art.php(premade by Marius) file instead
of mine and
it worked!
If I was wondering what is different, then there was large
amount of
additional code in my file:
In pre-made sample is 200 lines versus 242 in mine :(
Differences(looked with Winmerge):
MINE(not working): Working:
(why my DW8 inserts session handling in this way?)
1)
$_SESSION['MM_Username'] = NULL;
session_unregister('MM_Username');
$_SESSION['MM_UserGroup'] = NULL;
session_unregister('MM_UserGroup');
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);
2)
if (!isset($_SESSION)) { session_start();
session_start();
3)
in NONworking: (in WORKING - nothing )
(NB! this was a double-code - i think because of the redoings
(?recordset deleting & recreating?) )
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType,
$theDefinedValue = "",
$theNotDefinedValue = "")
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue)
: $theValue;
$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) :
mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) .
: "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue :
$theNotDefinedValue;
break;
return $theValue;
4)
NONworking:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"><!--
InstanceBegin
template="/Templates/admintemplate.dwt.php"
codeOutsideHTMLIsLocked="false" -->
Working:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
http://www.w3.org/TR/html4/loose.dtd">
<html>
5)
NonW:
<?php do { ?>
<tr class="topheader">
<td><?php echo $row_rsDeletedArticle['title_art'];
?></td>
Working:
<tr class="topheader">
<td><?php echo $row_rsDeletedArticle['title_art'];
?></td>
6)
NONW:
<td colspan="3"><?php echo
$row_rsDeletedArticle['text_art']; ?></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<?php } while ($row_rsDeletedArticle =
mysql_fetch_assoc($rsDeletedArticle)); ?>
</table>
<table width="30%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><form id="delete" name="delete" method="post"
action="delete_art.php">
<input name="yes" type="submit" id="yes" value="yes"
/>
<input name="id_art" type="hidden" id="id_art"
value="<?php echo $row_rsDeletedArticle['id_art']; ?>"
/>
</form>
</td>
<td><form id="cancel" name="cancel" method="post"
action="list_art.php">
<input name="no" type="submit" id="no" value="No" />
</form>
</td>
</tr>
</table>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_rsDeletedArticle == 0) { // Show if
recordset empty ?>
<p>You have successfully deleted the
article.</p>
<form id="back" name="back" method="post"
action="list_art.php">
<input name="back" type="submit" id="back" value="Back"
/>
</form>
<?php } // Show if recordset empty
?><p> </p>
<!-- InstanceEndEditable --></td>
Working:
<td colspan="2"><p><?php echo
$row_rsDeletedArticle['text_art']; ?></p></td>
</tr>
<tr>
<td colspan="2"><table width="15%" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td><form action="delete_art.php" method="post"
name="delete" id="delete">
<input name="yes" type="submit" id="yes" value="Yes">
<input name="id_art" type="hidden" id="id_art"
value="<?php echo $row_rsDeletedArticle['id_art'];
?>">
</form></td>
<td><form action="list_art.php" method="post"
name="cancel" id="cancel">
<input name="no" type="submit" id="no" value="No">
</form></td>
</tr>
</table></td>
</tr>
</table>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_rsDeletedArticle == 0) { // Show if
recordset
empty ?>
<p>You have successfully deleted the
article.</p>
<form action="list_art.php" method="post" name="back"
id="back">
<input name="back" type="submit" id="back"
value="Back">
</form>
<?php } // Show if recordset empty ?>
<p> </p>
<p> </p> <p>
</p></td>
</tr>
Boo-oo-hh!
It's enough for now
Please can someone give me advices about what is wrong with
the nonworking
(I deleted the section 3 from nonworking but it anyway
doesn't work)
AndreTa wrote:
> Oh, sorry!
>
> additional information - working with DW8.0.2, PHP
5.1.6, and with the
> "blog" database with MySQL 4.1.14
> (have also MySQL 5.0 - havn't tried with this... I'll do
it after sweet
> dreams and hard workday i.e. tomorrow)
> In local PC WinXP, Apache 2.2.3
>
> andreta
>
>
Similar Messages
-
CS6 Dreamweaver using PHP & MySQL - Delete Record Server Behavior?
When I try to insert the Delete Record server behavior. I get an error message about a DeleteRecord.js file, which seems to be missing or defective. I cannot use the server behavior. I have a file that I developed using CS5, and it does indeed delete the record, but does not proceed to the destination I want. I cannot change that except in the server behavior, so I'm stuck. I have noticed that server behaviors seem to disappear without apparent cause, as it seems to have in this case. I will appreciate any suggestions! Is there any way to embed a call to a target page manually? All is working WITHOUT the server behavior appearing, but I want to go to a confirmation display page that shows the record is indeed deleted, and we just return to the (now blank) delete confirmation page. That'll drive a user bonkers!
Thanks!
Delete Record in CS6 Dreamweaver using PHP & MySQL?Well, your error message is self-explanatory.
DW stores ServerBehaviors in 'Configuration' folder in installation directory. If one of the behavior JS files is missing/ corrupt, you'll see the error message you just did.
I've uploaded a functional, proper version of DeleteRecord.js onto my site for you to download. Here's the link:
http://www.sudarshan.me/adobeforum/dw/app/behavior-js/DeleteRecord.zip
Download this file, extract it and put DeleteRecord.js file in your installation directory as follows. If prompted, 'replace' your local copy:
Mac: Applications > Adobe Dreamweaver CS6 > Configuration > ServerBehaviors > PHP_MySQL
Windows: C:\Users\Your User Name\AppData\Roaming\Adobe\Dreamweaver CS6\[language]\Configuration\ServerBehaviors\PHP_MySQL
It should work as expected.
If that still doesn't solve the problem, reset your DW preferences and cache and try doing it. Follow the instructions here to reset cache: http://forums.adobe.com/thread/494811
Let us know how it goes.
-ST -
Clueless NEWBIE DEVELOPER, NEEDS ASSIST with Insert Record Server Behavior
Experienced DW designer learning CFMX7. I cannot seem to get
beyond this error message when using the Insert Record server
behavior to write data from a form into the database. Using MS
Access 2002, CFMX7's internal server, DW 6.0. Please note that I am
learning development for the first time and am using tutorials. I
was able to connect at one point but now I cannot.
See error message below:
The following information is meant for the website developer
for debugging purposes.
Error Occurred While Processing Request
Error Executing Database Query.
Syntax error in INSERT INTO statement.
Resources:
Enable Robust Exception Information to provide greater detail
about the source of errors. In the Administrator, click Debugging
& Logging > Debugging Settings, and select the Robust
Exception Information option.
Check the ColdFusion documentation to verify that you are
using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; .NET CLR 1.1.4322)
Remote Address 127.0.0.1
Referrer
http://localhost:8500/moosek/TMPu724j3nl2j.cfm
Date/Time 07-Aug-06 07:23 PM
Text
TextMongoSlade,
I had this exact same problem with a CFMX 7 datasource that
was set up as Microsoft Access with Unicode. It turns out that
"Password" is a reserved word in the Unicode driver. Or somewhere.
I got around it by putting square brackets, i.e., [ ] around the
column name, like this:
update MyTable
set [Password] = '#form.Password#'
where UserID = '#form.UserID#'
That solved the problem nicely. I hope this solution will
work for you as well. -
Using Dreamweaver MX 2004. I have a recordset created, and
need to update a table. When I select the Update Record server
behavior I get the following message "before using this behavior,
please create a recordset". However the recordset has already been
created, and it tests fine, I can see the data in the tables, and I
am able to insert a record, delete a record, but not update...
Using ASP JavaScript Server model with Access databse. Any help is
much appreciated.
Thanks! :Hi
Have you already made the binding? - it's not obvious from
your posting - but you should have a form with the initial data you
want to update bound to it before you can update.
I won't bang on about this because maybe you did it already.
bfn -
Update record server behavior preventing passage of form parameter in php
I have a multi-page survey set up in php. I am trying to pass a form variable to the next page, but the 'update record' server behavior is preventing me from passing the variable to the next page. I have tried including the variable as a parameter in the url, but this is not working either. Please help.
Can you not pass it onto the next page using a SESSION?
As an example say you want to pass the information from a form field with the name 'company' to another page.
At the top of the page that the form is submitted to you start a SESSION - <?php session_start(); ?> - then you collect the information from the form as normal BUT using a SESSION variable - $_SESSION['company']
The resulting php code might look like below:
<?php
session_start();
$_SESSION['company'] = $POST['company'];
?>
Then you can pass the SESSION variable on to as many page as you like:
So for instance the next page in the chain needs <?php session_start(); ?> at the top again to initiate a SESSION.
Then the resulting code may look like below. The information from the form field 'company' is being passed from page to page.
<?php session_start(); ?>
<?php
if(isset($_SESSION['company'])) {
echo $_SESSION['company'];
else {
echo "Company name is not set";
?> -
Insert/Update Record - Server Behavior
Help Please!
I have several pages with forms that insert records, but I
over the weekend when I went to open them from the web to
insert/update records errors appeared. They were working fine
before. Using PHP, MYSQL and Dreamweaver CS3
I have tried everything I know to do. I have recreated the
page, same problem as well as delete behaviors and reapply them.
Once the server behavior is added it no longer says Insert
Record in the Application window instead it says "Dynamic
Attribute" Further, when I click it to make any changes etc,
instead of the screen for Insert or Update record coming up it is a
"Dynamic Text box" regarding POST or GET or URL stuff.
Edited to add: And once posted, the page only shows an error
and references this line
<html xmlns="
http://www.w3.org/1999/xhtml">
Error Message
Parse error: syntax error, unexpected '<' on line 40
What can I do?You don't say which server-side language you're using, but the way that I would troubleshoot this in PHP is to use echo to display the value of $_SESSION['MM_Username'] at the bottom of the admin page. This is the session variable Dreamweaver uses to control access to a page with username and password. If the value is displayed, it means sessions are working, and the variable hasn't been destroyed.
If that works, move onto the next page, and use echo to display the value of $_SESSION['MM_Username'] as soon as the session has been started. To prevent being redirected to the fail page, temporarily comment out the following line:
header("Location: ". $MM_restrictGoTo);
Basically, you need to check what's happening to the session variable that controls access to the pages. -
Sequel Search Server Behaviors Problem
This code was made with php-msql server behaviors - recordset
pull down's....
I have a form to search for firstname or lastname or both but
I'm not getting the right results
SELECT * FROM phonebook WHERE firstname LIKE %s and lastname
LIKE %s
problem 1 - if I have NOTHING in the form then *all* records
get returned
I guess the problem is with blank form fields?
Q: How can I fix this?
full query below...still curious about this - thanks in advance
-
One wouldn't expect the code supplied by a MAJOR CORPORATION and WEB DEVELOPMENT TECHNOLOGY LEADER to blow an error on one of the server behaviors it supplies as part of its standard install. But then again, there is reality. The UpdateRecord.js, to be found in your installation on Windows 7 at ..ProgramFiles(x86(/Adobe Dreamweaver CS5.5/configuration/ServerBehaviors/Php_MySQL/UpdateRecord.js causes an error when it is selected from the SERVER BEHAVIORS menu. This happens BEFORE you I enter anything into the fields. The error states: "While executing onLoad in UpdateRecord.htm, the following JavaScript error(s) occured: At line 687 of file "........UpdateRecord.js": name has no properties. I've looked at the code and it is beyond my comprehension. Something about the NAME of a value in the node list.... I just don't have the chops to go rewriting Adobe's code. If I did, I'd be making the big bucks. Does anybody know what to do about this? About my system: Windows 7, 64bit, CS5.5 (on a lease so it is up to date) using PHP and MySQL, on a remote dedicated server running Apache on Linux. :<)McFrisco
Ok, I deserved that spanking. I was just frustrated. Sorry for the rant.
I've managed to figure out a workaround on this. There really is something wacky going on with Dreamweaver and the Update Record handler. Here's what I did:
How to trick DREAMWEAVER into writing an UPDATE RECORD.
Dreamweaver's server behavior for Update Record doesn't work correctly sometimes. The symptom of this is that when you try to fill in the popup form provided by the Server Behaviors/Update Record menu item, it doesn't allow you to choose form fields to update to the database if they are posted there by a previous page. It only allows you to choose them if they are bound to the database. This doesn't do any good, because you are updating a record with the information from the database you want to update, NOT with new information. Kind of weird... But here's the way to get around it. Its a bit tedious but it works.
1. On a clean php page, set up a form with the input fields matching the database fields you want to update. This page is to be used as the RESULT page of a form submitted on a previous page where the UPdate Record won't work due to conflicts, plugins, or some other unknown reason.
2. Connect to the database table you want to update, and set up a new RECORDSET on the page.
3. Bind all the form fields to the appropriate database fields.
4. Do an Update Record behavior based on this form. This will actually do nothing but update the record with the stuff that is already in the record, as noted above.
5. Delete the php code that sets up the record set. But, LEAVE THE Update Record code alone! It is correct.
6. Change the bindings of all the fields in the FORM to the $_POST[] variables passed from the form on the previous page. (Make sure the previous page form uses the POST, not the GET method.)
Now, when you submit the form it will pick up the values in the form, which have been passed from the previous page's form. -
Hello,
I'm trying to have a couple of pages with restricted access
on our website.
Using DWMX2004 and Coldfusion on Windows XP.
I used the login server behavior to achieve this.
It seems to work fine when the user name (email address in
this case) and password are not in the database, redirecting to the
failed login page, but when the user and password are correct I get
an error message ("Variable MM_LOGINACTION is undefined") and the
redirection doesn't happen.
I'm far from an expert, and I'm struggling to understand the
code, especially the reason why a CGI variable is used...
Could anyone please help me ?
Thanks in advance.
Ann
Here is the code of my login page (which is not in the root
directory, but in a folder ../en/):
<cfif IsDefined("FORM.txtEmail")>
<cfset
MM_redirectLoginSuccess="brochures_download.cfm">
<cfset MM_redirectLoginFailed="brochures_new.cfm">
<cfquery name="MM_rsUser" datasource="Calliope">
SELECT UserEmail,UserPass FROM tblUsers WHERE
UserEmail='#FORM.txtEmail#' AND UserPass='#FORM.txtPass#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.txtEmail>
<cfset Session.MM_UserAuthorization="">
</cflock>
<cfif IsDefined("URL.accessdenied") AND false>
<cfset MM_redirectLoginSuccess=URL.accessdenied>
</cfif>
<cflocation url="#MM_redirectLoginSuccess#"
addtoken="no">
<cfcatch type="Lock">
<!--- code for handling timeout of cflock --->
</cfcatch>
</cftry>
<cfelse>
<cflocation url="#MM_redirectLoginFailed#"
addtoken="no">
</cfif>
<cfelse>
<cfset MM_LoginAction=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_LoginAction=MM_LoginAction & "?" &
XMLFormat(CGI.QUERY_STRING)>
</cfif>
</cfif>
<html>
<head>
</head>
<body>
<form
ACTION="<cfoutput>#MM_loginAction#</cfoutput>"
METHOD="POST" name="FORM">
<table width="100%" cellpadding="2" cellspacing="2">
<tr>
<td>Your email </td>
<td><input name="txtEmail" type="text"
id="txtEmail" size="65"></td>
</tr>
<tr>
<td>Password</td>
<td><input name="txtPass" type="text" id="txtPass"
size="8"></td>
</tr>
<tr>
<td> </td>
<td><input name="Login" type="submit" id="Login"
value="Login"></td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>You need to ensure that sessions have been enabled in your
application.cfm
file.
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"kangy" <[email protected]> wrote in message
news:[email protected]...
> Hello,
>
> I'm trying to have a couple of pages with restricted
access on our
> website.
> Using DWMX2004 and Coldfusion on Windows XP.
>
> I used the login server behavior to achieve this.
> It seems to work fine when the user name (email address
in this case) and
> password are not in the database, redirecting to the
failed login page,
> but
> when the user and password are correct I get an error
message ("Variable
> MM_LOGINACTION is undefined") and the redirection
doesn't happen.
>
> I'm far from an expert, and I'm struggling to understand
the code,
> especially
> the reason why a CGI variable is used...
> Could anyone please help me ?
> Thanks in advance.
> Ann
>
> Here is the code of my login page (which is not in the
root directory, but
> in
> a folder ../en/):
>
> <cfif IsDefined("FORM.txtEmail")>
> <cfset
MM_redirectLoginSuccess="brochures_download.cfm">
> <cfset MM_redirectLoginFailed="brochures_new.cfm">
> <cfquery name="MM_rsUser" datasource="Calliope">
> SELECT UserEmail,UserPass FROM tblUsers WHERE
> UserEmail='#FORM.txtEmail#'
> AND UserPass='#FORM.txtPass#'
> </cfquery>
> <cfif MM_rsUser.RecordCount NEQ 0>
> <cftry>
> <cflock scope="Session" timeout="30"
type="Exclusive">
> <cfset Session.MM_Username=FORM.txtEmail>
> <cfset Session.MM_UserAuthorization="">
> </cflock>
> <cfif IsDefined("URL.accessdenied") AND false>
> <cfset MM_redirectLoginSuccess=URL.accessdenied>
> </cfif>
> <cflocation url="#MM_redirectLoginSuccess#"
addtoken="no">
> <cfcatch type="Lock">
> <!--- code for handling timeout of cflock --->
> </cfcatch>
> </cftry>
> <cfelse>
> <cflocation url="#MM_redirectLoginFailed#"
addtoken="no">
> </cfif>
> <cfelse>
> <cfset MM_LoginAction=CGI.SCRIPT_NAME>
> <cfif CGI.QUERY_STRING NEQ "">
> <cfset MM_LoginAction=MM_LoginAction & "?" &
> XMLFormat(CGI.QUERY_STRING)>
> </cfif>
> </cfif>
> <html>
> <head>
> ...
> </head>
>
> <body>
> ....
> <form
ACTION="<cfoutput>#MM_loginAction#</cfoutput>"
METHOD="POST"
> name="FORM">
> <table width="100%" cellpadding="2"
cellspacing="2">
> <tr>
> <td>Your email </td>
> <td><input name="txtEmail" type="text"
id="txtEmail"
> size="65"></td>
> </tr>
> <tr>
> <td>Password</td>
> <td><input name="txtPass" type="text"
id="txtPass"
> size="8"></td>
> </tr>
> <tr>
> <td> </td>
> <td><input name="Login" type="submit"
id="Login"
> value="Login"></td>
> <td> </td>
> </tr>
> </table>
>
> </form>
> ...
> </body>
> </html>
>
>
> -
Delete Record Behavior doesn't wait for Submit button
I have master / detail page set. From the detail set there are links to delete or update a record. When I click the link to delete the record, it goes to the confirmation page with the correct record. Now, when I add the delete record server behavior and a submit button, this is what happens. As soon as I click the link to go to the delete confirm page, the record deletes and the page redirects to the page I put in the server behavior. It doesn't show the confirm page and doesn't wait for me to hit the confirm button. The page runs and successfully deletes the page from the DB.
How do I get it to wait until I hit the submit button?You need to surround your delete query with an "If" statement that checks for a confirmation variable of some sort, then when the user clicks the confirmation link you can pass the necessary variable and the ID of the record the delete query is expecting.
As an alternative you could use a JS alert fuction to ask the user if they are sure they want to delete the record and then allwo the delet to run after confirmation. To do this you could use code like this...
<input type="submit" name="DELETE" value="DELETE"
onclick="return confirm('Are you SURE you want to DELETE this record?')">
Lawrence *Adobe Community Expert*
www.Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in ASP, PHP and CF
www.twitter.com/LawrenceCramer -
I've set up a simple database for adding event news to a
site. I'm pretty new to PHP, but I have the Insert, Update, and
Display pages working properly. However the Delete Record page is
being a big pain. I have it set up just as it explains in
Dreamweaver Help, as well as a tutorial i am using as a backbone
for this project. Its a form with a hidden filed that is
dynamically pulling my ID. I have the Delete behavior pointing at
the same ID and record set.
My Delete link is properly setting up a dynamic page with the
title of record to be deleted showing up just fine. Also, the
redirect page is correct after hitting the Delete button. Which
makes me believe the issue is happening in somewhere in the
behavior. None of my records are being deleted when I go back to
the Display page. They are still there. Im pointing the behavior at
my Primary record so im not sure what's going on. I'm a first-timer
to this. Any help would be much appreciated.
Here is my code:Hi
I was reading your post and realized that I had the same
troubles the first time I tried to setup a record deletion page.
I hope the following helps.
What I ended up doing was to set up 3 pages..
1) a user list page of all users in the users table
2) a confirmation page to show user info
3) a delete page which does the actual deletion
This first page was a simple repeat region table showing the
entire list of users in the database table. I linked the username
to the conformation page with a simple URL Parameter to isolate the
user I want to delete
Here is the code
<a href="admin_users_delconfirm.php?id=<?php echo
$row_rsUsers['id']; ?>
The on the confirmation page I have a delete button graphic
which is linked to the delete page in the same way.
Code:
<a href="admin_users_delete.php?id=<?php echo
$row_rsUsers['id']; ?>
Finally on the delete page I applied the" delete record"
server behaiviour so that the deletion is done when the page loads.
You can also have it redirect back to the master list of users when
the deletion is done.
It may seem a little redundant to have 3 pages, but the
purpose of the 2nd page is to give the user an opportunity to
change their mind and also to remind them that the delete action
cannot be undone.
I hope this helps you.
Good Luck and Good Coding! -
Find Server Behavior/JavaScript Errors
I am getting an error whenever I created Update or Insert
record server behaviors in my pages. When I go through the process
of adding the behavior, it inserts the VBScript for my ASP page,
but then I get an error message when findServerBehaviors runs. In
DW8, it was referring the InsertRecord.htm, in DW CS3, it referres
to InsertRecord2.htm whenever I run and Insert Server Behavior. As
I said, it inserts the code, but it will not show an Insert Record
in the Server Behaviors panel.
If I close and open DW, the next time I open the page, the
behaviors will be listed in the panel, but the moment I make any
changes to the page, and the findServerBehaviors javascript is
triggered, I get the error message and lose the listing of the
insert or update in the behavior panel even those the VBScript code
is still in the page. This is super annoying.
Anyone have this problem?It's probably some extension you have installed that's
causing the issue. I found a tech support article that helped -
can't remember where, but basically you recreate your configuration
by renaming your existing config folder to something like
"configuration-old" and then restart DW. It will create a new
config folder and you will have to re-enable all your extensions.
This solved the problem for me initially and I enabled a few
extensions every few days until one day the error started happening
again. For me the problem was caused by the extension "Justso
Picture Window". Once I disabled that extension, my problems went
away. It would be nice if DW had some way of telling you which
extension is causing an issue. -
Deleting records - mySQL / PHP
I've just worked through this whole database thing from
scratch again after a little glitch, and it's all working pretty
well.
I do still have the issue with deleting records - I have the
search results page which is fine, and has a delete options at the
end of the row.
It was working just fine bringing up the 'confirm deletion'
page with the selected record - but it goes wrong after I add the
'delete record' server behaviour.
Basically after I do, when I click delete in the results
page, it skips the 'confirm deletion' page, going straight to the
'deletion confirmed' page.
It does still delete the record at least, but it would be
good to have the confirmation page.
Here's a
link
(if you need to log in use 'admin' and 'password'.)
This is all the script code in the 'confirm delete' page :
<?php require_once('../Connections/ConnHandprint.php');
?>
<?php
function GetSQLValueString($theValue, $theType,
$theDefinedValue = "", $theNotDefinedValue = "")
$theValue = (!get_magic_quotes_gpc()) ?
addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) .
"'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue :
$theNotDefinedValue;
break;
return $theValue;
if ((isset($_GET['recordID'])) && ($_GET['recordID']
!= "")) {
$deleteSQL = sprintf("DELETE FROM Contacts WHERE
ContactID=%s",
GetSQLValueString($_GET['recordID'], "int"));
mysql_select_db($database_ConnHandprint, $ConnHandprint);
$Result1 = mysql_query($deleteSQL, $ConnHandprint) or
die(mysql_error());
$deleteGoTo = "contactdeleted.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $deleteGoTo));
$colname_Recordset1 = "1";
if (isset($_GET['recordID'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ?
$_GET['recordID'] : addslashes($_GET['recordID']);
mysql_select_db($database_ConnHandprint, $ConnHandprint);
$query_Recordset1 = sprintf("SELECT * FROM Contacts WHERE
ContactID = %s", $colname_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $ConnHandprint)
or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
Any ideas?
Cheers,
IainHi,
It is a good idea to do it in database level such that declare foreign key from child to parent table and specify DELETE CASCADE.
regards,
' -
Delete record using multi select ...
Hi All,
I have a form associated with 4 reports region and retrieve report for that specific customer. In one report, i have option to delete the saved image by using multi selector check box (single or multiple) and hit the delete button. It works fine if there is no records for the other reports. i can upload image and delete record without any problem. As soon as I have records for other reports, multi selector does not work. when I try to delete, i get this error message -
ORA-20001: Error in multi row delete operation: row= 13, ORA-01403: no data found, delete from "RATIS"."RTT_FILES" where "FIL_ID" = :p_pk_col
Error multi row operation failed.
but if I remove the records for the other report, it works again. I have only one process for multi delete in this page. Seems it is conflicting with the other reports when trying to delete.
Can anybody help with this please?
Thanks,
TajuddinHi
That depends if the other "reports" are actually tabular forms as well? If they are, see:
http://apex.oracle.com/pls/otn/f?p=31517:163
this explains how to set up more than one tabular form on a page.
Otherwise, we would probably need to see your code to see what may be happening
Andy -
Delete record behaviour (PHP/mySQL)
I've just worked through this whole database thing from
scratch again after a little glitch, and it's all working pretty
well.
I do still have the issue with deleting records - I have the
search results page which is fine, and has a delete options at the
end of the row.
It was working just fine bringing up the 'confirm deletion'
page with the selected record - but it goes wrong after I add the
'delete record' server behaviour.
Basically after I do, when I click delete in the results
page, it skips the 'confirm deletion' page, going straight to the
'deletion confirmed' page. It's as tho' simply going to the
confirmation page is triggering the deletion, rather than requiring
the 'delete record' button to be pressed. Does the form / button
require an 'action'? Although as far as I can tell I followed the
instructions
correctly, but something is going wrong on the confirmation page.
It does still delete the record at least, but it would be
good to have the confirmation page.
Here's a link (if you need to log in use 'admin' and
'password'.)
link
This is all the script code in the 'confirm delete' page :
<?php require_once('../Connections/ConnHandprint.php');
?>
<?php
function GetSQLValueString($theValue, $theType,
$theDefinedValue = "", $theNotDefinedValue = "")
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue)
: $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) .
"'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue :
$theNotDefinedValue;
break;
return $theValue;
if ((isset($_GET['recordID'])) && ($_GET['recordID']
!= "")) {
$deleteSQL = sprintf("DELETE FROM Contacts WHERE
ContactID=%s",
GetSQLValueString($_GET['recordID'], "int"));
mysql_select_db($database_ConnHandprint, $ConnHandprint);
$Result1 = mysql_query($deleteSQL, $ConnHandprint) or
die(mysql_error());
$deleteGoTo = "contactdeleted.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $deleteGoTo));
$colname_Recordset1 = "1";
if (isset($_GET['recordID'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ?
$_GET['recordID'] : addslashes($_GET['recordID']);
mysql_select_db($database_ConnHandprint, $ConnHandprint);
$query_Recordset1 = sprintf("SELECT * FROM Contacts WHERE
ContactID = %s", $colname_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $ConnHandprint)
or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
Any ideas?
CheersHello,
S. Khawar wrote:
my question is that when I execute DELETE_RECORD built in it fails due to constraint restriction and Oracle forms raise message that "Child record exist/unable to delete record " until here it's Ok but Oracle Forms still removes record from the screen/form and move up the remaining records(although record is failed to delete).Yet this is the default forms behaviour. Because when you press delete it will remove from the screen but not from the database till you use COMMIT as francois mentioned.
I want the Oracle Form to do not remove record from screen/form once it's failed to delete record actually.Yes, for this type of requirement. Why don't you check dependency of record before removing the record. What i mean is you can use the code in KEY-DELREC trigger like below (before using the DELETE_RECORD built-in) for checking if child record exists then show message otherwise remove. For example...
DECLARE
vCntRec NUMBER;
BEGIN
SELECT COUNT(*)
INTO vCntRec
FROM child_table_name
WHERE key_column = :form_key_column_name;
IF vCntRec>0 THEN -- Here means record found in child table so it will not remove from screen but message will appear.
MESSAGE('<Your error message goes here...>');
MESSAGE('<Your error message goes here...>');
RAISE FORM_TRIGGER_FAILURE;
ELSE -- Here mean there is not dependency so it will remove which is default forms behaviour.
DELETE_RECORD;
END IF;
END;So, when you will press button for delete first it will check for any child record if exsits then it will display message and will not vanish from the screen otherwise it will remove from the screen and furthor COMMIT will remove from database.
-Ammad
Edited by: Ammad Ahmed on Jul 7, 2010 8:48 AM
Maybe you are looking for
-
I am getting an error message when prompted to enter my password in the app store.
When I try to purchase or download an app, I am prompted for my password, but after I enter it, I get a dialogue box that says "Unkwown error." I have tried this several times and even reset my password. I am able to purchase apps on my computer in i
-
Is there any way to get unique numbers for a label?
Im writing a lottery code and would like to know if there is anyway to get my 6 numbers in my label to be different this is my code so far Public Class frmMain Private randGen As New Random Private Sub btnExit_Click(sender As Object, e As EventArgs)
-
Why is my iTunes 10.4 crashing every time I open it?
Hello, so I just downloaded 10.4 iTunes. I have SL10.6.8 Last night I turned on the full screen feature even though I don't have Lion OS. This morning my iTunes worked fine. And I had a similiar problem with my GarageBand. (Crashing unexpectedly) App
-
Outlook Shared Contacts Sync Issue
**Before i start, i posted this in the Outlook section and was told to post it the Outlook for Exchange section.. So i posted this in the Outlook for Exchange section and the Moderator tells me to post it in the Outlook section.. So i'm being thrown
-
Back button for internal hyperlinks?
I've created internal hyperlinks with IBA (to other chapters in the text) and for the most part, they work. But there is no back button? Help! And thanks!