/[LeafOK_CVS]/fenglin/bbs/message.inc.php
ViewVC logotype

Contents of /fenglin/bbs/message.inc.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Sun Apr 27 04:32:05 2025 UTC (10 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.2: +2 -2 lines
Trim trailing whitespaces

1 <?php
2 function check_new_msg(int $uid, mysqli $db_conn) : int
3 {
4 $new_msg = 0;
5
6 $sql = "SELECT COUNT(*) AS msg_count FROM bbs_msg
7 WHERE toUID = $uid AND new = 1 AND deleted = 0";
8
9 $rs = mysqli_query($db_conn, $sql);
10 if ($rs == false)
11 {
12 echo("Query message error: " . mysqli_error($db_conn));
13 return -1;
14 }
15
16 if ($row = mysqli_fetch_array($rs))
17 {
18 $new_msg = $row["msg_count"];
19 }
20
21 mysqli_free_result($rs);
22
23 return $new_msg;
24 }
25 ?>

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1