How do you use the forum? Also Technical News.
Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators
Forum rules
This forum is NOT a forum where you post a technical questions about osRose, osiRose or ospRose. Use the dedicated forum for that!
by Rifke on Mon Jun 09, 2008 4:12 pm
Changing Table(s)You alter the table:
channels and add a new field 'uptime' (see SQL)
-
- ALTER TABLE `channels` ADD `uptime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
-
Creating PHP fileThis will just give a basic idea.
-
- <?php
- /* only world server. You can delete the part:
- * WHERE port >= 29200
- * to show everything, (meaning full names are a pre)
- *
- */
- $sql = "SELECT name,TIME_FORMAT(UNIX_TIMESTAMP() - UNIX_TIMESTAMP(uptime),'%T') AS uptime_t FROM channels WHERE port >= 29200";
- $qry = mysql_query($sql);
- if ( $qry === false ) {
- echo " Sorry but there has been a database issue, due this issue we where not able to retrieve the uptime status.";
- } elseif ( mysql_num_rows($qry) == 0 ) {
- echo 'There are no running services.';
- } else {
- while ( $arr = mysql_fetch_assoc($qry) ) {
- echo $arr['name']. 'is running for '.$arr['uptime_t']. '<br />';
- }
- }
- ?>
-
-
Rifke
- Pero pero
-
- Posts: 719
- Joined: Thu Aug 09, 2007 3:01 pm
- Location: Belgium
-
Return to Some Help / News
Users browsing this forum: No registered users and 4 guests