Closed Thread
Results 1 to 3 of 3

Thread: How can I delete mySQL records from an html or jsp page?

  1. #1
    bigz008 is offline Newbie
    Join Date
    Mar 2010
    Posts
    3
    Rep Power
    0

    How can I delete mySQL records from an html or jsp page?

    Hi guys, I've created a .jsp page which gets all the records I put in the database (from mySQL Query browser) and displays them in a table.

    Code:
    <html>
    
    <table style="width: 100%" class="style4" cellspacing="1" cellpadding="3">
                
    <tr>
    <td style="width: 90px" id="tableheadercell" class="style3">
    <strong>Organsation ID</strong></td>
    <td style="width: 50px"  id="tableheadercell" class="style3">
    <strong>Length</strong></td>
    <td style="width: 50px" id="tableheadercell" class="style3">
    <strong>Amount</strong></td>
    <td style="width: 80px"  id="tableheadercell" class="style3">
    <strong>Trial Period</strong></td>
    <td style="width: 90px" id="tableheadercell" class="style3">
    <strong>Promo Minutes</strong></td>                             
    </tr>
    <% 
               String skuResult[][];
               skuResult = null;
            try {
            
    String []  skuFields = {"orgID", "length", "amount", "trial_period", "promoMins"};
    
    CRUD skuCRUD = new CRUD ("sku", "skuID");  
    skuResult = skuCRUD.getRecords(skuFields,0,0);
    
            } catch (Exception e) { Tracer.logERROR("[sku/skuContent.jsp] "+e); e.printStackTrace();    } 
                             
    
    String    skuID="";  
    String    organisationID="";  
    String    cc_flag="";   
    String    length="";  
    String    amount="";  
    String    active="";  
    String    trialPeriod="";  
    String    description="";  
    String    promoText="";  
    String    promoMinutes="";  
            
    for (int i = 0; i < skuResult.length; i++) {
    organisationID = skuResult[i][0]; 
    length = skuResult[i][1] ;
    amount = skuResult[i][2];
    trialPeriod = skuResult[i][3];
    promoMinutes = skuResult[i][4];
    %> 
    
    <tr>
    <td style="width: 90px" class="ms-list1-0001-odd"><%= organisationID %></td>
    <td style="width: 50px" class="ms-list1-0001-odd"><%= length %></td>
    <td style="width: 50px" class="ms-list1-0001-odd"><%= amount %></td>
    <td style="width: 80px" class="ms-list1-0001-odd"><%= trialPeriod %></td>
    <td style="width: 90px" class="ms-list1-0001-odd"><%= promoMinutes %></td>
    </tr>
    <%     Tracer.logERROR("[sku/skContent.jsp] "+"errors are after this"); } %>
                                            
    </table>                                
    </html>
    *The CRUD file is where I connect to the db....

    How can I add the functionality to add/delete the records from within my .jsp code?

    Thanks in advance.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    gokuajmes's Avatar
    gokuajmes is offline Programming God
    Join Date
    Jan 2010
    Location
    India
    Posts
    516
    Blog Entries
    5
    Rep Power
    12

    Re: How can I delete mySQL records from an html or jsp page?

    i donno much on JSp but are there controls to present data like what .NET has,because .net controls provide functionality to add ,delete,update on the fly

  4. #3
    bigz008 is offline Newbie
    Join Date
    Mar 2010
    Posts
    3
    Rep Power
    0

    Re: How can I delete mySQL records from an html or jsp page?

    Yea, I guess I can try opening the .jsp file with another program which contains those controls like Microsoft Expression Web2...
    Thanks.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. mysql records
    By tontonskie in forum Database & Database Programming
    Replies: 4
    Last Post: 12-13-2010, 04:18 PM
  2. Replies: 1
    Last Post: 06-02-2010, 05:28 PM
  3. Displaying records from a mySQL DB
    By aakinn in forum PHP Development
    Replies: 37
    Last Post: 03-26-2010, 01:18 PM
  4. Replies: 12
    Last Post: 03-15-2008, 04:34 AM
  5. getting the value of checkboxes to delete the records in the sql table
    By pavsuri in forum ASP, ASP.NET and Coldfusion
    Replies: 1
    Last Post: 05-07-2007, 12:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

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