0

short question I cannot TRUNCATE nor DELETE * FROM table in PHP code. In MySQL it works like charm, but I am getting crazy why it doesnt work in code when I have two same tables and codes and one works and second doesnt.

PHP///DELETE TEMP TABLE

$link = mysqli_connect("localhost", "user", "xxx", "db_test");
$truncate_table = "TRUNCATE TABLE temp_table;";
$delete = mysqli_query($link, $truncate_table);

////MYSQL
CREATE TABLE `temp_table` 
(
    `ID` INT(32) NOT NULL AUTO_INCREMENT,   
    `task_number` VARCHAR(50) NULL DEFAULT '0',   
    `type` VARCHAR(50) NULL DEFAULT '0',
    `assign_date` DATE NULL DEFAULT NULL,
    `team` VARCHAR(50) NULL DEFAULT NULL,
    `task` VARCHAR(50) NULL DEFAULT NULL,
    `comment` TEXT NULL,
    PRIMARY KEY (`ID`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;

I tried: 1. change quotes, change form of mysql query, use delete * from, remove and recreate table, nothing,

Also no error is shown in echo but as I said in MySQL the command is successfull.

marhyno
  • 677
  • 1
  • 8
  • 20

0 Answers0