| 1 |
<? |
<?php |
| 2 |
function check_new_msg(int $uid, mysqli $db_conn) : int |
function check_new_msg(int $uid, mysqli $db_conn) : int |
| 3 |
{ |
{ |
| 4 |
$new_msg = 0; |
$new_msg = 0; |
| 12 |
echo("Query message error: " . mysqli_error($db_conn)); |
echo("Query message error: " . mysqli_error($db_conn)); |
| 13 |
return -1; |
return -1; |
| 14 |
} |
} |
| 15 |
|
|
| 16 |
if ($row = mysqli_fetch_array($rs)) |
if ($row = mysqli_fetch_array($rs)) |
| 17 |
{ |
{ |
| 18 |
$new_msg = $row["msg_count"]; |
$new_msg = $row["msg_count"]; |
| 19 |
} |
} |
| 20 |
|
|
| 21 |
mysqli_free_result($rs); |
mysqli_free_result($rs); |
| 22 |
|
|
| 23 |
return $new_msg; |
return $new_msg; |
| 24 |
} |
} |