-4

I am using custom code for my website. Some delete all records from mysql database regularly after every week or 10 days. The deletion of records will also delete all the updates in db which has been made in this time frame. Kindly someone guide me how do I solve that issue.

I am using PHP and MySQL.

Thanks

2 Answers2

0

You should use MySQLi prepared statements for putting in variables: http://php.net/manual/en/mysqli.prepare.php

You should also be sanitizing the user input before passing it into the query, as well as ensuring you validate it for expected values

Bryan Zwicker
  • 642
  • 1
  • 6
  • 24
0

Use prepared queries in while querying your database and use parameterized queries.

Manage your database connections correclty

Sourabh Kumar Sharma
  • 2,864
  • 3
  • 25
  • 33