Skip to content Skip to sidebar Skip to footer

Deleting And Updating Data From Database

I have created a code that connects to database and i want to delete data from database using a button the same for update. but i just can display data in a table and cant delete.

Solution 1:

The vast majority of Perl CGI problems can be solved by:

  • Adding use strict and use warnings to your code
  • Fixing all of the errors that now appear in your error log

Solution 2:

You assign a value to $row_idafter you try to use that variable to create your query.

Additionally, using raw user input in SQL queries makes you vulnerable to XSS attacks. Rewrite your code to use parameterized queries

Solution 3:

Do not use my if you do not want a new variable. Remove all my's from the method calls:

my $sth->finish();           
my $dbh->commit ordie$DBI::errstr;

Post a Comment for "Deleting And Updating Data From Database"