Select a row to delete/modify

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Select a row to delete/modify

    Hi.

    Suppose to have read and displayed (using PHP) a group of row of a DB
    table on a dinamyc table on a HTML/PHP page.

    The number of row displayed could be from 1 to n. Each row contains
    informations and also a cell with a unique ID of the element.

    I would like to show at the beginning of each line of the table a
    couple of cells containing two different icons (one for delete and one
    for modify) so the user could click on it to delete/modify the
    corresponding row on the DB table.

    In other word I need to delete/modify the Dbtable row which have the
    ID of the line where the icon was clicked. This means also that when a
    icon is clicked I must jump to a PHP routine passing it the ID that
    appears on the same line of the icon clicked.

    I have seen a similar method of delete/modify on the phpAdmin program,
    but I was unable to understand how it work because of the complexity
    of that routines.

    To achieve my need I can use, if necessary, also Javascript
    statements.


    Thank you from Franco in Italy
    Franco Fellico' Guest

  2. Similar Questions and Discussions

    1. Can't delete .LCK files, so can't modify or save anychanges!
      I am having a huge problem with .LCK files. I thought that these could only be generated in Contribute, but suddenly several of the directories in...
    2. Select and delete unused symbols won't record in an action
      The selection and deletion of unused brushes, styles, and swatches from the palettes in a document record properly in an action. (For some reason the...
    3. SELECT OK, INSERT and DELETE Problems in Windows 2003
      Hi, I´m not getting write, alter or exclude any register in my table. Only read without problems. What is happening ? Generate the error:
    4. Clearing "Clean" & a Select Modify question
      Hi All, Suppose I have 100 X 100 pixel square filled in with Navy Blue. What I really want is to hollow out the inside of that square so that I...
    5. Loss of Modify Table > Delete Row or Insert Row in 6.1
      I updated from 6.0 to 6.1 and now the Modify Table options are all greyed out. Is there another way to access them in 6.1? If not, I need to...
  3. #2

    Default Re: Select a row to delete/modify

    Franco Fellico' wrote:
    > I would like to show at the beginning of each line of the table a
    > couple of cells containing two different icons (one for delete and one
    > for modify) so the user could click on it to delete/modify the
    > corresponding row on the DB table.
    >
    > In other word I need to delete/modify the Dbtable row which have the
    > ID of the line where the icon was clicked. This means also that when a
    > icon is clicked I must jump to a PHP routine passing it the ID that
    > appears on the same line of the icon clicked.
    Include the record id in the link associated with the delete/modify
    icon, for example:

    <?php
    // ...
    // data from db is in the array $dbdata
    foreach ($dbdata as $record) {
    echo '<a href="delete.php?id=', $record['id'], '">delete</a> / ';
    echo '<a href="modify.php?id=', $record['id'], '">modify</a>';
    echo ' | ', $record['name'], ' | ', $record['eyecolor'], ' | '; // ...
    // ...
    }
    ?>


    to generate HTML that looks like

    _delete_ / _modify_ | Franco Fellico | brown | ...
    _delete_ / _modify_ | Pedro Graca | brown | ...
    ...


    and in delete.php and modify.php
    check for $_GET['id'] and use it (after validating) for
    deleting/modifying the record.


    HTH

    --
    ..sig
    Pedro Graca Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139