Store
Community Documentation

v3 Knowledgebase

Easy Clean Database (Please be careful)

Tried and tested on version 2.0.7 (Build 4)

Do Not Try This Unless you have taken a copy of your database first...

This will empty any table in your databases so please be very carefull...

I'm sorry it's a little primative but it works...

First make a php file "clean.php" for expample but could be anything and copy and paste the code below from and include "<?php" to "?>" at the bottom of the code into the new php file, make sure you place your info in the text which is bold.
Then save it to your computer.

Next upload it to a folder on your server.

If placed in the Root you can run it by placing in your browser address bar http://www.yoursite.com/clean.php, but if you placed it into a folder for example "test" you can run it by placing in your browser address bar http://www.yoursite.com/test/clean.php.

Good luck and I hope it helps.
I will be working on a much better version a module which will run from within the admin panel when I get the time if know one else does it first.


<?php
$con = mysql_connect("localhost","Your_Database_User_Name","Your_Database_Password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db("Your_Database_Name",$con);

$selt = array(
0=> "phpfox_ko_arcade_news",
1=> "phpfox_user_ip",
2=> "phpfox_admincp_login",
3=> "example: you can increase this list but look at the layout",
4=> "example: you must increase the number for additional lines",
5=> "example: also include the Prefix phpfox or phpfox2 etc and then the table
to empty but remember to also include the _ to join the Prefix_and_Table_Name
",
6=> "example: on the last line dont place the commer , after the last quotation mark"


);
$cnt = count($selt);
for($t=0;$t<$cnt;$t++)
{
$tablename = $selt[$t];
mysql_query ("DELETE FROM `$tablename`");
print_r ($tablename);
}
echo "<table border='1'>
<tr>
<th>All Done!</th>
</tr>";
mysql_close($con);
?>