I'm trying to solve a problem which I've now for 2days. But with any kind of success
I want to create something where people can track their progress, so if somebody 'creates a progress' certain information need to be selected from the DB and inserted into other table.
for now I got this:
ID | ITEM | MOBNAME | GAME | LOG_ID | LOG_NAME
1 | test test3 | spider | TEST | 1 | just a test
As you see, I need COLUMN item
among each other not in 1 single row. like this:
ID | ITEM | MOBNAME | GAME | LOG_ID | LOG_NAME
1 | test | spider | TEST | 1 | just a test
1 | test3 | spider | TEST | 1 | just a test
1 | test4 | spider | TEST | 1 | just a test
This is my current code for selecting and inserting:
$sql = "INSERT INTO log_create(`name`, name2, game, monster, info)VALUES('$name', '$name2', '$game', '$mobname', '$info')";
$log = $db->query("SELECT * FROM log_mitem WHERE mobname = '" .$mobname. "' AND game = '" .$game. "'") or die($db->error);
if($log1 = $log->fetch_object())
{
while($loco = $log->fetch_object())
{
$item .= "$loco->itemname";
}
$logss = "INSERT INTO log_drops(`item`, mobname, game, log_id, log_name)VALUES('$item', '$mobname', '$game', '$id', '$name')";
if($result1 = $db->query($logss));
}