$connect = mysqli_connect("localhost", "root", "", "root");
foreach($_POST["id"] as $id)
$truncatequery = "TRUNCATE TABLE tbl_trans";
$insquery = "INSERT INTO tbl_trans (id, branch, outlet, user, item, serialno, dater, problem, status, remarks, tech)
SELECT id, branch, outlet, user, item, serialno, dater, problem, status, remarks, tech
FROM tbl_repair WHERE id = '".$id."'";
Anyone here can help my issue?..
I tried to TRUNCATE tbl_trans before inserting data from tbl_repair to tbl_trans. Now my problem is if I execute the query it only copy 1 row instead of multiple data. I tried to check if my insert method is working by removing TRUNCATE query as I expected it work. It copies multiple data, but something happen when I add the TRUNCATE query it copies only 1 row...
Thanks in advance.