I have just changed a script to use
$query=$database->query (INSERT...)
but I also have several if statements that add to the query if the number of input fields generated from the previous page is higher than expected.
The original query is as follows...
$query=$database->query("INSERT INTO pool_" . $pool_name . " (team_name) VALUES('$team_one'), ('$team_two'), ('$team_three'), ('$team_four'), ('$team_five'),
('$team_six'), ('$team_seven'), ('$team_eight')");
I understand the error I am getting, I just don't know how to avoid it.
The error is Catchable fatal error: Object of class PDOStatement could not be converted to string in D:\newXamp\htdocs\real_do_create_pool.php on line 32
the line of code is...
$query.=", ('$team_nine'), ('$team_ten'), ('$team_eleven')";
How can I add to the query whilst using $database->query
Thanks