public static function db_survey_answer_insert($survey_id, $survey_answer) {
6
doquery("INSERT INTO {{survey_answers}} SET `survey_parent_id` = {$survey_id}, `survey_answer_text` = '{$survey_answer}'");
7
}
8
9
public static function db_survey_answer_text_select_by_news($announce) {
10
return doquery("SELECT survey_answer_text FROM {{survey_answers}} WHERE survey_parent_id = {$announce['survey_id']};");
11
}
12
13
/**
14
* @param $announce
15
*
16
* @return array|bool|mysqli_result|null
17
*/
18
public static function db_survey_answers_get_list_by_parent($announce) {
19
$survey_query = doquery("SELECT * FROM {{survey_answers}} WHERE survey_parent_id = {$announce['survey_id']} ORDER BY survey_answer_id;");
20
21
return $survey_query;
22
}
23
24
/**
25
* @param $announce
26
*
27
* @return array|bool|mysqli_result|null
28
*/
29
public static function db_survey_get_answer_texts($announce) {
30
$survey_query = doquery(
31
"SELECT survey_answer_text AS `TEXT`, count(DISTINCT survey_vote_id) AS `VOTES`
32
FROM `{{survey_answers}}` AS sa
33
LEFT JOIN `{{survey_votes}}` AS sv ON sv.survey_parent_answer_id = sa.survey_answer_id
34
WHERE sa.survey_parent_id = {$announce['survey_id']}
35
GROUP BY survey_answer_id
36
ORDER BY survey_answer_id;"
37
);
38
39
return $survey_query;
40
}
41
42
/**
43
* @param $survey_id
44
* @param $survey_vote_id
45
*
46
* @return array|bool|mysqli_result|null
47
*/
48
public static function db_survey_answer_get($survey_id, $survey_vote_id) {
49
$is_answer_exists = doquery("SELECT `survey_answer_id` FROM `{{survey_answers}}` WHERE survey_parent_id = {$survey_id} AND survey_answer_id = {$survey_vote_id};", true);
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: