Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
retypos-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
retypos-server
Commits
a0b22b96
Commit
a0b22b96
authored
May 28, 2018
by
Георгий Попов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Задача 12794] Добавил проверку на ошибку вставки в базу данных и отправку…
[Задача 12794] Добавил проверку на ошибку вставки в базу данных и отправку корректного ответа пользователю
parent
6934ad6f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
server.php
server.php
+11
-1
No files found.
server.php
View file @
a0b22b96
...
...
@@ -125,7 +125,17 @@ if ($email_users) {
try
{
$data
=
array
(
'NULL'
,
$email_users
[
0
][
'id_site'
],
$userdata
[
'url'
],
$userdata
[
'text'
],
$userdata
[
'context'
],
$userdata
[
'comment'
],
0
);
$STH
=
$DBH
->
prepare
(
"INSERT INTO messages (id, site_id, link, text, context, comment, date, status) VALUES (?, ?, ?, ?, ?, ?, DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%s'), ?)"
);
$STH
->
execute
(
$data
);
$result
=
$STH
->
execute
(
$data
);
if
(
$result
!==
true
)
{
$errorInfo
=
$STH
->
errorInfo
();
error_log
(
"Возникла ошибка при добавлении опечатки в базу данных. Код SQLSTATE:
{
$errorInfo
[
0
]
}
.
Код ошибки драйвера:
{
$errorInfo
[
1
]
}
. Текст ошибки:
{
$errorInfo
[
2
]
}
"
);
echoJsonData
(
array
(
'success'
=>
'false'
,
'message'
=>
$_language
[
$code_language
][
'error_database'
]));
return
;
}
}
catch
(
PDOException
$e
)
{
echoJsonData
(
array
(
'success'
=>
'false'
,
'message'
=>
$_language
[
$code_language
][
'error_database'
]));
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment