Make Call To Database From Menu.tpl

Results 1 to 2 of 2
  1. #1
    Banned tutuyale is offline
    Sep 2011 Join Date

    happy Make Call To Database From Menu.tpl

    Make Call To Database From Menu.tpl
    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 by tutuyale; 10-04-16 at 08:51 PM.

  2. #2
    Account Upgraded | Title Enabled! ubiByte is offline
    True MemberRank
    Jan 2012 Join Date
    United StatesLocation

    Re: Make Call To Database From Menu.tpl

    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



    @mysql_select_db($database) or die( "Unable to select database");

    $query = "INSERT INTO contacts VALUES ('','$first','$last','$phone','$mobile','$fax','$email','$web')";

    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