Hi i need help to create one php code for call from menu.tpl to TRUNCATE s1_movement Example: whem thetable s1_movement have more of 2500 entrys this broke the game and can run normal, its for this, i want create one call from the admin menu.tpl only press example: "Delet All Moves" and the table is truncate or empty entrys to "0" but i want make this from the admin menu and dont like enter to the phpMyadmin, please help me dears friends!
Thank You =)
Last edited by tutuyale; 10-04-16 at 08:51 PM.
Why don't you create a static page for the admin, all you need to do is call the query in that page using PHP. It'll do that for you without having to go into the database to run your query.
Here's an example
See my query example you can just type out your query to truncate the table there, and just put this code into a button for the admin. Once you click that button it will truncate or remove rows whichever is your goal<?
$username="username";
$password="password";
$database="your_database";
$first=$_POST['first'];
$last=$_POST['last'];
$phone=$_POST['phone'];
$mobile=$_POST['mobile'];
$fax=$_POST['fax'];
$email=$_POST['email'];
$web=$_POST['web'];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO contacts VALUES ('','$first','$last','$phone','$mobile','$fax','$email','$web')";
mysql_query($query);
mysql_close();
?>