Добрый день.
Подскажите, пожалуйста, как подготовить запрос, но не выполнять его, а вывести текст запроса на страницу? В нем явно ошибка, но не понимаю, как ее увидеть?
Код вот такой:
$sql = "
INSERT INTO match_raw (
match_id,
dt_accept,
team1_set1_point,
team2_set1_point,
team1_set2_point,
team2_set2_point,
team1_set3_point,
team2_set3_point,
team1_set4_point,
team2_set4_point,
team1_set5_point,
team2_set5_point,
arbiter1_id,
arbiter2_id,
arbiter1_mark,
team1_best_player_id,
team2_best_player_id,
author_id,
comment,
status
)
VALUES (
:match_id,
:dt_accept,
:team1_set1_point,
:team2_set1_point,
:team1_set2_point,
:team2_set2_point,
:team1_set3_point,
:team2_set3_point,
:team1_set4_point,
:team2_set4_point,
:team1_set5_point,
:team2_set5_point,
:arbiter1_id,
:arbiter2_id,
:arbiter1_mark,
:team1_best_player_id,
:team2_best_player_id,
:author_id,
:comment,
:status
)
";
$stmt = $this->dbh->prepare($sql);
$publish_date =date("Y-m-d H:i:s");
$stmt->execute( array(
':match_id' => $dataforupload['match_id'],
':dt_accept' => $publish_date,//здесь дата текущая в формате mysql должна быть
':team1_set1_point' => $dataforupload['points'][0],
':team2_set1_point' => $dataforupload['points'][1],
':team1_set2_point' => $dataforupload['points'][2],
':team2_set2_point' => $dataforupload['points'][3],
':team1_set3_point' => $dataforupload['points'][4],
':team2_set3_point' => $dataforupload['points'][5],
':team1_set4_point' => $dataforupload['points'][6],
':team2_set4_point' => $dataforupload['points'][7],
':team1_set5_point' => $dataforupload['points'][8],
':team2_set5_point' => $dataforupload['points'][9],
':arbiter1_id' => $dataforupload['arbiter1'],
':arbiter2_id' => $dataforupload['arbiter2'],
':arbiter1_mark' => $dataforupload['arbitermark'],
':team1_best_player_id' => $dataforupload['bestteam1'],
':team2_best_player_id' => $dataforupload['bestteam2'],
':author_id' => $constructoptions['current_user_id'],
':comment' => $dataforupload['comment'].'-- do not approve (new edition)',
':status' => 1,
));