Im not sure if I understand you, but:
if I do, try to make a while loop an start inserting.
$con = mysql_connect("localhost","sample","sample");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("logging", $con);
$result = mysql_query("SELECT `members`.`name`,`time_attendance`.`time` FROM members\n"
. "LEFT JOIN `log_time`.`time_attendance` ON `members`.`code` = `time_attendance`.`code` LIMIT 0, 30");
while($row=mysql_fetch_array($result)){
$time = $row['time_attedance'];
$name = $row['name'];
mysql_query("INSERT INTO history_log(name, time) VALUES(`$name`, `$time`)");
}
I think this will work. But I didn't test it.
NOTE: This may be really slow, because it will practically create 30 queries, there is one thing that can wok too:
Im thinking about the way how to make it quicker, I will tell you If I have found something