Jump to content

[SOLVED] Wanting to automate a sql statement


Voodoo Jai

Recommended Posts

Fter many hours of searching I found this section of code:

 

<?php
MYSQL_CONNECT('localhost','database_username','database_password');
@mysql_select_db("database_name") or die(mysql_error());

$query="TRUNCATE xoops_session";
$query="ALTER TABLE table-name AUTO_INCREMENT =1";

mysql_query($query);
mysql_close()
?> 

 

I want to specify a specific table within a db, so do I need to change

 

TRUNCATE xoops_session

into

 

TRUNCATE db-table-name

 

then how do I get it to run at a specific time of the day and

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.