/[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.4 - (show annotations)
Tue Apr 29 11:55:32 2025 UTC (10 months, 2 weeks ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +0 -1 lines
Remove redundant PHP closing tag

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 }

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