PHP Delete Record Issue

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!

Similar Messages

  • Foxpro delete records issue

    Hi All,
    How can delete the rows in IS that are marked deleted in FoxPro database? Or
    How to skip those rows?
    I am importing the data with IS package using VS2010. I am connecting the FoxPro database file using OLEDB.
    Thanks

    Hi,
    I believe you need to customize your SSIS package to include script task or execute query and issue your statement to delete the rows that marked as deleted for example, if your data contains a column to indicate that this row is delete you can simply put
    your statement as
    DELETE FROM TABLE
    WHERE COLUMN = 1 -- 1 means deleted.
    if it doesn't help please provide a sample data.
    I hope this is helpful.
    Please Mark it as Answered if it answered your question
    OR mark it as Helpful if it help you to solve your problem
    Elmozamil Elamir Hamid
    MCSE Data Platform
    MCITP: SQL Server 2008 Administration/Development
    MCSA SQL Server 2012
    MCTS: SQL Server Administration/Development
    MyBlog

  • 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,
    Iain

    Hi,
    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 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?
    Cheers

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

  • Deleting Record from Database in PHP

    I'm trying to figure out how to delete a record from my
    database. I already have a recordset with my form selected. But
    when I try to add "Delete Record," I can never seem to figure out
    why it won't delete anything when I load the page in a browser, it
    won't even go to the page I told it to go to after it deletes a
    record. My guess is it's what I'm entering in the "Delete Record"
    part of it, any help would be great. Also, my id is primary key if
    that helps. Thanks ahead of time.

    edwin@aw wrote:
    > However, whenever I click on the hyperlink, the link
    will becomes
    >
    http://www.domain.com/www.LinkFromDatabase.com.
    Why it always append the web
    > site's address?? Do I miss something?
    This is happening because your link doesn't begin with
    http://.
    > echo "<a href='$link' target='_blank'> $link
    </a>";
    This should be echo "<a href='
    http://$link' target='_blank'> $link
    </a>";
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • 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

  • Delete Record Automatically deleting

    I have been trying to see if anyone has had this same issue with no real luck. I was hoping someone could give me a quick hand. I am created a delete record page as you would usually do. It is supposed to populate like any other page first so that yiou see the user's information. You should then be able to hit the delete button to delete the actual record. Unfortunately as soon as you go to the page it automatically deletes the record not giving you a chance to review the file first.
    Here is the standard delete record code from Dreamweaver:
    if ((isset($_GET['ID'])) && ($_GET['ID'] != "")) {
      $deleteSQL = sprintf("DELETE FROM entry WHERE ID=%s",
                           GetSQLValueString($_GET['ID'], "int"));
      mysql_select_db($database_toyosupport, $toyosupport);
      $Result1 = mysql_query($deleteSQL, $toyosupport) or die(mysql_error());
      $deleteGoTo = "/support/EnterDealer/Admin_Edit_dealer.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
        $deleteGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $deleteGoTo));
    My form is pretty basic:
    <form action="/support/EnterDealer/Admin_Edit_dealer.php" method="post" name="delete_User" id="delete_User">
    Form is set to post so i can;t see any reason it should automatically delete the file.
    Any ideas? 

    OK so thi sis not the "RIGHT" answer as I still don't know why it is automatically deleting. But with that in mind all I did was create a "View" page stating "ARE YOU SURE YOU WOULD LIKE TO DLETE THIS USER?" After that they are then sent to the delete record page which then deletes the record. If anyone wants to take a stab at it here is the complete code for the "delete" page. There may be something i am just not seeing ...
    <?php  session_start(); ?>
    <?php require_once('../../Connections/toyosupport.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $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;
    if ((isset($_GET['ID'])) && ($_GET['ID'] != "")) {
      $deleteSQL = sprintf("DELETE FROM entry WHERE ID=%s",
                           GetSQLValueString($_GET['ID'], "int"));
      mysql_select_db($database_toyosupport, $toyosupport);
      $Result1 = mysql_query($deleteSQL, $toyosupport) or die(mysql_error());
      $deleteGoTo = "/support/EnterDealer/Admin_Edit_dealer.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
        $deleteGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $deleteGoTo));
    $colname_rsDEALERLIST = "-1";
    if (isset($_POST['ID'])) {
      $colname_rsDEALERLIST = $_POST['ID'];
    mysql_select_db($database_toyosupport, $toyosupport);
    $query_rsDEALERLIST = sprintf("SELECT * FROM entry WHERE ID = %s", GetSQLValueString($colname_rsDEALERLIST, "int"));
    $rsDEALERLIST = mysql_query($query_rsDEALERLIST, $toyosupport) or die(mysql_error());
    $row_rsDEALERLIST = mysql_fetch_assoc($rsDEALERLIST);
    $totalRows_rsDEALERLIST = mysql_num_rows($rsDEALERLIST);
    ?>
    <!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" xml:lang="en" lang="en" dir="ltr">
    <head>
    </head>
    <!--<body oncontextmenu="return false;">-->
    <body>
    <form method="post" name="delete_User" id="delete_User">
      <table border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#FFFFFF" width="100%">
        <tr valign="top" bgcolor="#FFFFFF">
          <td colspan="3" bgcolor="#3399CC" class="BoldTextBLK"><font class="drupal_blend_9pt">Please
            enter ALL  information.
            <input name="ID" type="hidden" id="ID" value="<?php echo $row_rsDEALERLIST['ID']; ?>" />
          </font></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td width="38%" bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt">First
            Name/Pr&eacute;nom <br />
            </font></span></td>
          <td width="14%" colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Name']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td width="38%" bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Last
            Name/Nom</font></span></td>
          <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['NameLast']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#006699">
          <td height="5" bgcolor="#FFFFFF"> </td>
          <td height="5" colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Password']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Store
            Number <font size="1">(Toyo Account #)</font></font></span></td>
          <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['DealerNumber']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td width="38%" bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Company
            Name/Nom du D&eacute;taillant </font></span></td>
          <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Company']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Address/Adresee</font></span></td>
          <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Address']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">City/Ville</font></span></td>
          <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['City']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Province</font></span></td>
          <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['DealerProv']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Postal
            Code/Code Postal</font></span></td>
          <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['PostalCode']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Email/Courriel</font></span></td>
          <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['EmailAddress']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Phone/Num&eacute;ro</font></span></td>
          <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Phone']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt"><font class="drupal_blend_9pt">Fax</font></span></td>
          <td colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Fax']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#006699">
          <td height="5" bgcolor="#FFFFFF"><span class="Drupal_Blend_9pt">Price List</span></td>
          <td height="5" colspan="2" bgcolor="#FFFFFF"><?php echo $row_rsDEALERLIST['Plist_0']; ?><br />
            <?php echo $row_rsDEALERLIST['Plist_U']; ?> <br />
            <?php echo $row_rsDEALERLIST['Plist_G']; ?></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td colspan="3" bgcolor="#FFFFFF"><font class="drupal_blend_9pt"> </font></td>
        </tr>
        <tr valign="top" bgcolor="#FFFFFF">
          <td width="38%" align="right" bgcolor="#FFFFFF"><font class="drupal_blend_9pt"><b>Delete record.</b></font><font color="#FF0000">Note this is permanent!</font></td>
          <td colspan="2" bgcolor="#FFFFFF"><font class="drupal_blend_9pt">
            <input name="Delete_User" type="submit" id="Delete_User" value="Delete_User" />
          </font></td>
        </tr>
      </table>
    </form>
    </body>
    </html>
    <?php
    mysql_free_result($rsDEALERLIST);
    ?>

  • Control record issue !

    Hi All,
    I am handling UK Payroll and got an issues related to payroll run and control record,
    Issue 1: The payroll driver (RPCALCG0) has skipped around 1500 Employees against payroll run for particular period
    Issue 2: How control record allowed user to Exit control record for period in which EE's skipped in payroll
    Please provide your valuable suggesting in regard to resolve the above two issues,
    Thanks in advance.
    Regards,
    Devendra Reddy D.

    Hi,
    Issue 1: The payroll driver (RPCALCG0) has skipped around 1500 Employees against payroll run for particular period
    Say you want to run payroll for FEB..
    But payroll control record may not be in FEB... It may be in March..
    Issue 2: How control record allowed user to Exit control record for period in which EE's skipped in payroll
    Payroll control record may have been deleted on the month of Jan..& been set in Release mode in March month directly...
    So feb month gets skipped & Exit mode in Feb is skipped too...
    For detailed info.. Go to PA03 enter payroll ares & click display option..
    Under Go To tab.. look for Control Record Log..
    Regards,
    Veeram

  • Delete record from the form and from the database

    hi,
    i want delete record from the form and the database ,but the record is only delete from the from !!!
    this is my code :
    if //condition then
    delete_record;
    commit;
    end if ;
    Any solutions ??
    thnx

    You have unique key field(s) on the table you are trying to insert which actually restricts you from inserting the same value again.
    When you are deleting the record and issue commit there is a record to be inserted in the table which is a duplicate that's why you are getting this unique error.
    As oracle is not able to insert your commit fails and stops your deletion of record from table

  • Delete recording from VSMS server

    In VSMS server, how can delete recording from storage? and can delete some of recording, like 1 hour from all recording or 1 day?

    Hello mshah,
    This is not recommended at all to delete recording files manually or for certain durations since every files has reference id created which are being associated to cameras.Deleting files in such can cause issue to the server.
    What is the reason behind deleting those files from server?
    Regards
    Nadeem Ahmed

  • How to delete record from table control in BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    Hi,
    While doing recording check for Filter button available for the table control, if it available then do the recording for the same.
    Once it is done while passing the data from internal table put the value into Filter field.
    Hope it resolves your issue.
    Thanks & Regards.
    Nagaraj Kalbavi

  • What is the best approach to track deleted records

    Dear all,
    We have build a CMS platform which is based on SQL server 2012 tables structure hosted in Azure.
    We have build on top of this some REST API method in order to access data from any type of client application.
    The issues we need to solved now is what his the best way to track deleted records in order that client application gets informed through web service about deleted data from our CMS.
    We were thinking of 2 path actually :
    - having a kind of Ghost table for each of our real table where deleted records will be inserted into ( physical delete ). This would mean adding as many Ghost tables as we have production tables
    - Adding a IsDeleted flag to each of our table which will be set to true when a record is deleted from our CMS ( logical delete ). This would means adding an IsDelete field to each of our tables, create and update all our store procedure and web services
    in order to taken in account that new filter criteria to fetch our records. Quite huge job
    Will there be any other approach ?
    We are looking the best solution with minimum impact on our current solution
    reagards
    Your knowledge is enhanced by that of others.

    Hello,
    @Tom, based on your question
    "The question would be what do you need to do with the deleted records and how long do you need to keep them?"
    When records is deleted, then I simply want to delete them and informed any client application about deleted items in order to get data in Sync. I will not have any reporting on deleted data !
    The only reason of tracking delete tables items, is simply to informed client application through web service sync about the data to be ignored. Client application have a caching database records for performance reason and is is require to not used data
    from that local storage which has been reported as deleted by the SQL server on Aure.
    Does this make sense ?
    regards
    Your knowledge is enhanced by that of others.

  • How to delete records from dynamic internal table.

    Hi Experts,
    Need urgent help!!!
    Issue is with Dynamic internal tables.
    Below is code written by me :
    FORM select_query USING Lw_tabnam
                      TYPE  t682i-kotabnr.
      DATA :  lw_line  TYPE REF TO data,
              lw_line1 TYPE REF TO data.
        CREATE DATA Lw_line    TYPE (lw_TABNAM).
        ASSIGN      Lw_line->* TO   <WA_tbl>.
        CREATE DATA LW_LINE    TYPE STANDARD TABLE OF (Lw_tabnam)
                               WITH NON-UNIQUE DEFAULT KEY.
        ASSIGN      Lw_line->* TO <TBL>.
        SELECT * FROM  (Lw_tabnam)
                 INTO CORRESPONDING FIELDS OF TABLE <TBL>
                 WHERE (t_keys).
    Endform.
    code is working fine.
    here even the table name and where condition are dynamic,everything is fine upto this point.
    Now i have to delete some record from <TBL> based on some conditons.
         for ex : ( here lc_fieldname is KUNNR)
          loop at t_kunnr.
              lw_tabix = sy-tabix.
            Read table <tbl>
                    with key (lc_fieldname) = t_kunnr-kunnr ASSIGNING <wa_tbl>.
            If sy-subrc = 0.
            *Delete
            delete <tbl> from <wa_tbl>
    delete <tbl> index  lw_tabix.
            Endif.
         Endloop.
    The above delete statement doesn't work ,even we can't use index as it gives a syntax error " something related to "index is not allowed in standard table or hash table.
    Can you help me ab't how to delete records in Dynamic internal table?
    Other option that i am thinking of is to create a static table of type dynamic table.
    means, data itab type standard table of <tbl> .I know the syntax is wrong ,however is there any way to do this?
    Thanks in advance ,
    If you have any suggestion ab't this then do let me know.
    bye,
    Gaurav.

    Hi
    I wrote this code and it works fine:
    DATA LW_TABNAM(10) VALUE 'LFA1'.
    DATA : LW_LINES TYPE REF TO DATA,
           LW_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <TABLE> TYPE TABLE,
                   <WA>    TYPE ANY.
    CREATE DATA LW_LINES TYPE TABLE OF (LW_TABNAM)
    WITH NON-UNIQUE DEFAULT KEY.
    ASSIGN LW_LINES->* TO <TABLE>.
    CREATE DATA LW_LINE TYPE (LW_TABNAM).
    ASSIGN LW_LINE->* TO <WA>.
    DO 10 TIMES.
      APPEND INITIAL LINE TO <TABLE>.
    ENDDO.
    SY-TABIX = 4.
    DELETE <TABLE> INDEX SY-TABIX.
    WRITE SY-SUBRC.
    I hope it help you
    Max

  • [DW MX 2004] DELETE RECORD

    Hi,
    I can't DELETE RECORD in LOCAL SERVER (MySQL Server 5.0)
    and REMOTE SERVER , but INSERT AND UPDATE WORKS.
    Page code is
    <?php require_once('../Connections/connpuntofermo.php');
    ?>
    <?php
    session_start();
    $MM_authorizedUsers = "";
    $MM_donotCheckaccess = "true";
    // *** Restrict Access To Page: Grant or deny access to this
    page
    function isAuthorized($strUsers, $strGroups, $UserName,
    $UserGroup) {
    // For security, start by assuming the visitor is NOT
    authorized.
    $isValid = False;
    // When a visitor has logged into this site, the Session
    variable
    MM_Username set equal to their username.
    // Therefore, we know that a user is NOT logged in if that
    Session
    variable is blank.
    if (!empty($UserName)) {
    // Besides being logged in, you may restrict access to only
    certain
    users based on an ID established when they login.
    // Parse the strings into arrays.
    $arrUsers = Explode(",", $strUsers);
    $arrGroups = Explode(",", $strGroups);
    if (in_array($UserName, $arrUsers)) {
    $isValid = true;
    // Or, you may restrict access to only certain users based
    on their
    username.
    if (in_array($UserGroup, $arrGroups)) {
    $isValid = true;
    if (($strUsers == "") && true) {
    $isValid = true;
    return $isValid;
    $MM_restrictGoTo = "index.php";
    if (!((isset($_SESSION['MM_Username'])) &&
    (isAuthorized("",$MM_authorizedUsers,
    $_SESSION['MM_Username'],
    $_SESSION['MM_UserGroup'])))) {
    $MM_qsChar = "?";
    $MM_referrer = $_SERVER['PHP_SELF'];
    if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
    if (isset($QUERY_STRING) && strlen($QUERY_STRING)
    > 0)
    $MM_referrer .= "?" . $QUERY_STRING;
    $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar .
    "accesscheck=" .
    urlencode($MM_referrer);
    header("Location: ". $MM_restrictGoTo);
    exit;
    ?>
    <?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['ID'])) && ($_GET['ID'] != "")) {
    $deleteSQL = sprintf("DELETE FROM news WHERE ID=%s",
    GetSQLValueString($_GET['ID'], "int"));
    mysql_select_db($database_connpuntofermo, $connpuntofermo);
    $Result1 = mysql_query($deleteSQL, $connpuntofermo) or
    die(mysql_error());
    $deleteGoTo = "ok-cancella.php";
    if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
    header(sprintf("Location: %s", $deleteGoTo));
    mysql_select_db($database_connpuntofermo, $connpuntofermo);
    $query_rs_elenco = "SELECT ID, `data`, titolo FROM news ORDER
    BY ID DESC";
    $rs_elenco = mysql_query($query_rs_elenco, $connpuntofermo)
    or
    die(mysql_error());
    $row_rs_elenco = mysql_fetch_assoc($rs_elenco);
    $totalRows_rs_elenco = mysql_num_rows($rs_elenco);
    ?>
    <html><!-- InstanceBegin
    template="/Templates/template-adm.dwt"
    codeOutsideHTMLIsLocked="false" -->
    <head>
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>amministrazione Piadineria Punto
    Fermo</title>
    <!-- InstanceEndEditable --><meta
    http-equiv="Content-Type"
    content="text/html; charset=iso-8859-1"><style
    type="text/css">
    <!--
    body {
    background-color: #CCD57B;
    margin-bottom: 0px;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    -->
    </style>
    <link href="../css/style.css" rel="stylesheet"
    type="text/css">
    <style type="text/css">
    @import "news/domnews.css";
    </style>
    <script type="text/javascript"
    src="news/domnews.js"></script>
    <!-- InstanceBeginEditable name="head" --><!--
    InstanceEndEditable -->
    </head>
    <body>
    <table width="100%" height="100%" border="0"
    align="center" cellpadding="0"
    cellspacing="0">
    <tr>
    <td align="center" valign="middle"><table
    width="760" height="430"
    border="0" align="center" cellpadding="0" cellspacing="1"
    bgcolor="#A7B339">
    <tr>
    <td width="779" align="left" valign="middle"
    bgcolor="#FFFFCC"><table width="760" height="334"
    border="0" cellpadding="0"
    cellspacing="0">
    <tr>
    <td align="center"
    class="body"><strong>AMMINISTRAZIONE SITO
    PUNTO FERMO </strong></td>
    </tr>
    <tr>
    <!-- InstanceBeginEditable name="header" --><td
    height="42"
    align="center" valign="top" class="body"><a
    href="menu.php"
    class="body">torna
    a men&ugrave; principale </a></td>
    <!-- InstanceEndEditable --> </tr>
    <tr>
    <!-- InstanceBeginEditable name="body" -->
    <td align="center" valign="top"
    class="body"><p>ELENCO NEWS
    INSERITE</p>
    <table width="505" border="0" cellpadding="5"
    cellspacing="1"
    bgcolor="#999999" class="body">
    <tr bgcolor="#FFFFA8">
    <td>ID</td>
    <td width="104">DATA</td>
    <td width="134">TITOLO</td>
    <td width="110"> </td>
    <td width="112"> </td>
    </tr>
    <?php do { ?>
    <tr align="left" valign="top" bgcolor="#FFFFCC">
    <td><?php echo $row_rs_elenco['ID'];
    ?></td>
    <td><?php echo $row_rs_elenco['data'];
    ?></td>
    <td><?php echo $row_rs_elenco['titolo'];
    ?></td>
    <td><a href="mod-news.php?ID=<?php echo
    $row_rs_elenco['ID']; ?>"
    class="body">MODIFICA</a></td>
    <td><form name="elimina1" method="post"
    action="">
    <input type="submit" name="Submit" value="ELIMINA">
    </form></td>
    </tr>
    <?php } while ($row_rs_elenco =
    mysql_fetch_assoc($rs_elenco)); ?>
    </table>
    <p>  </p></td>
    <!-- InstanceEndEditable --> </tr>
    <tr>
    <td> </td>
    </tr>
    </table></td>
    </tr>
    </table> </td>
    </tr>
    </table>
    </body>
    <!-- InstanceEnd --></html>
    <?php
    mysql_free_result($rs_elenco);
    ?>
    Where is error?
    Thanks.

    MX 2004 was always a bit "gummy" on this.  Instead of using the DW wizard, I downloaded a free version of Microsoft SQL Server Express Edition.  I use that for all table Inserts, Updates,etc.   This accesses the tables directly on the server.  Nothing needs to be synced, put, gotten or whatever.  Use DW for Form and UI creation and making prebuilt queries.
    Hope that helps
    Jerry H

  • 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

Maybe you are looking for