Results 1 to 3 of 3
Jun 5, 2007, 13:54 #1
- Join Date
- Apr 2007
- 0 Post(s)
- 0 Thread(s)
Wondering if someone could help me with a major headache i'm getting that I can't solve and I'd like to get solved quickly as it's holding me back in my development of my football site.
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 with my above piece of code please?