Wondering if someone could help me with a major headache i'm getting that I can't solve/
I’m trying to create an array to post multiple values into my database table.
$lastinsert = mysql_insert_id(); //to get report_id from reports table
$sql = array();
foreach($_REQUEST['r'] as $row)
$sql = sprintf("('%s', %d)",
$player_id = $row['player_id'],
$team_id = $_GET['team_id']);
$query_three = mysql_query("INSERT INTO `goals2` ( `player_id`,`team_id`, `report_id` )
VALUES ('$sql', '$lastinsert')");
Now I want to get the first two values from the array I created and the $lastinsert value (report_id) from the last insert in another table. However it just outputs the message ‘query is empty’ in my validation checks to see if any data enters the database.
Anyone see what’s wrong please?