diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
commit | 19985dbb8c0aa66dc4bf7905abc1148de909097d (patch) | |
tree | 2cd5a5d20d7e80fc2a51adf60d838d8a2c40999e /utils/setLastStatus.php | |
download | 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.gz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.bz2 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.lz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.xz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.zst 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.zip |
Diffstat (limited to 'utils/setLastStatus.php')
-rw-r--r-- | utils/setLastStatus.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/setLastStatus.php b/utils/setLastStatus.php new file mode 100644 index 0000000..a728afb --- /dev/null +++ b/utils/setLastStatus.php @@ -0,0 +1,17 @@ +<?php
+/*
+ * Created on 21.12.2009
+ *
+ * To change the template for this generated file go to
+ * Window - Preferences - PHPeclipse - PHP - Code Templates
+ */
+ include_once('../function.php');
+ $str = "SELECT st.status, st.usr_id FROM srv_userstatus AS st LEFT JOIN (SELECT s.usr_id, max(s.datetime) as statusdatetime FROM srv_userstatus as s GROUP BY s.usr_id ) AS s ON s.usr_id = st.usr_id ";
+ $qry = sisplet_query($str);
+ while ($row = mysqli_fetch_assoc($qry)) {
+ $str2 = "UPDATE srv_user SET last_status = '".$row['status']."' WHERE id = '".$row['usr_id']."'";
+
+ $updated = sisplet_query($str2);
+ print_r($updated."<br>");
+ }
+?>
|