Всем привет, как можно реализовать очистку таблиц посредством скрипта php ? чтобы поставить в крон чтоб удалялись товары и категории пробовал уже разные варианты не получается(( вот пример
<?php
$link = mysql_connect('localhost', 'root', 'password');
$rv = mysql_select_db('dbname', $link);
$sql = "TRUNCATE TABLE `oc_category`";
$sql = "TRUNCATE TABLE `oc_category_description`";
$sql = "TRUNCATE TABLE `oc_category_path`";
$sql = "TRUNCATE TABLE `oc_category_to_layout`";
$sql = "TRUNCATE TABLE `oc_category_to_store`";
$sql = "TRUNCATE TABLE `oc_product`";
$sql = "TRUNCATE TABLE `oc_product_description`";
$sql = "TRUNCATE TABLE `oc_product_to_store`";
$sql = "TRUNCATE TABLE `oc_product_to_layout`";
$sql = "TRUNCATE TABLE `oc_product_to_category`";
$sql = "TRUNCATE TABLE `oc_product_image`";
$sql = "TRUNCATE TABLE `oc_product_attribute`";
mysql_query($sql);
?>
<?php
$link = mysql_connect('localhost', 'root', 'password');
$rv = mysql_select_db('dbname', $link);
$sql = "TRUNCATE TABLE `oc_category`";
$sql = "TRUNCATE TABLE `oc_category_description`";
$sql = "TRUNCATE TABLE `oc_category_path`";
$sql = "TRUNCATE TABLE `oc_category_to_layout`";
$sql = "TRUNCATE TABLE `oc_category_to_store`";
$sql = "TRUNCATE TABLE `oc_product`";
$sql = "TRUNCATE TABLE `oc_product_description`";
$sql = "TRUNCATE TABLE `oc_product_to_store`";
$sql = "TRUNCATE TABLE `oc_product_to_layout`";
$sql = "TRUNCATE TABLE `oc_product_to_category`";
$sql = "TRUNCATE TABLE `oc_product_image`";
$sql = "TRUNCATE TABLE `oc_product_attribute`";
mysql_query($sql);
?>