Now I have one table and copy this table into another table and this work... But now I have one new array in new table and I need to save now date... How to connect this 2 queries into one..
$sql = "INSERT INTO $tbl_name2(name, money) SELECT name, money FROM $tbl_name WHERE id='$idd'";
$sql ="INSERT INTO $tbl_name2(time)VALUES('$time')";
$result = mysql_query($sql);
Simply add the parameter to your first query.
$sql = "INSERT INTO $tbl_name2(name, moneytime) SELECT name, money,$time FROM $tbl_name WHERE id='$idd'";
But you shouldn't use the mysql_*
API because these is depricated. And also you should use prepared statement. TThese are much more safty and readable.
If I am understanding it correctly this is what you need.
$sql = "INSERT INTO $tbl_name2(name, money, time) SELECT name, money, '".$time."' FROM $tbl_name WHERE id='$idd'";
$result = mysql_query($sql);