You have used mysql_connect()
in the update clause of the code. If your PHP version is 7 and above it will not work (will work for 5.5 and 5.6 versions but with a warning) as it is deprecated.
Warning
This extension was deprecated in PHP 5.5.0, and it was removed in PHP
7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more
information. Alternatives to this function include:mysqli_connect() PDO::__construct()
Read more here.
I don’t see the point in establishing a new connection while editing when there is a database connection that was made in the beginning of the script. Use the same functions used to insert data to the database from your script:
$db->query("UPDATE tablename SET column_name = value");
// to check no. of rows affected by the previous query
$db->affected_rows()
2
solved Edit and delete aren’t executing in the database in my PHP form [duplicate]