PHP clears all the data in the MySql specified data table. When the editor of Agni was wandering around the Internet, this was an article from a technical blog. It was said to be an article. There was no text, only code. After testing, it worked Use it and share it with everyone now.
There are three files in total, but they can also be merged into one.
1.conn.php:
Copy to Clipboard
Quoted content:
[www.bkjia.com]
$id=mysql_connect("localhost","root","mysql") or die('Connection failed:' . mysql_error());
if(mysql_select_db("phpjcdb",$ id)) //Explanation: phpjcdb is the database name
echo "";
else
echo ('Database selection failed:' . mysql_error());
mysql_query("set names gb2312") ; //Set to Simplified Chinese
?>
2.index.php:
Copy to Clipboard
Quoted content:
[www.bkjia.com]
include("conn.php");
?>
Clear all data in the specified data table