Web development lesson 43 PHP MySQL, cleaning table, error reporting and insert query

#pashto #phpmysql
This article demonstrates how to use PHP to delete every record from a MySQL table.

In other words, we are erasing every record from the database and starting from scratch.

Because we're deleting the table itself, the table will still be around. However, we are eliminating every row (or every record) in the table.

This can be used if we only want to clear the table's records and don't care about the table's structure.
In PHP 5.5.0, this extension was marked for deprecation, and in PHP 7.0.0, it was eliminated. Instead, PDO MySQL or MySQLi should be utilized. See also MySQL: A Guide to API Selection. These are some alternatives to this action:
mysqli error() \sPDO::errorInfo()
The description
mysql error ($link identifier = NULL) for resource: string
returns the last MySQL function's error message. The MySQL database backend no longer issues warnings in response to errors. Instead, retrieve the error text using mysql error(). If you want to use it, be sure to check the value before running another MySQL function. It should be noted that this function only returns the error text from the most recent MySQL method that was executed (excluding mysql error() and mysql errno()).
Web design
Be the first to comment