Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Make Call To Database From Menu.tpl

Banned
Banned
Joined
Sep 17, 2011
Messages
71
Reaction score
1
Hi i need help to create one php code for call from menu.tpl to TRUNCATE s1_movement Example: whem the
table 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:
Junior Spellweaver
Joined
Jan 11, 2012
Messages
190
Reaction score
19
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

<?
$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();
?>

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
 
Back
Top