- added curly braces around conditional code blocks
- added space between if/foreach/... and brace
- rewrote a code block so if dbm::is_result() fails it will abort, else the id
is fetched from INSERT statement
- made some SQL keywords upper-cased and added back-ticks to columns/table names
Signed-off-by: Roland Haeder <roland@mxchange.org>
$r = q("SELECT `id` FROM `contact` WHERE `id` IN ( " . $str . ") AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 ");
- if ($r) {
+ if (dbm::is_result($r)) {
$ret = array();
foreach ($r as $rr) {
$ret[] = intval($rr['id']);
);
echo json_encode($o);
killme();
- }
- else
+ } else {
$r = array();
+ }
if (dbm::is_result($r)) {
if ($post_id) {
proc_run(PRIORITY_HIGH, "include/notifier.php", "mail", $post_id);
return intval($post_id);
- } else {
+ }
+ else {
return -3;
}