Reducto Posted May 18, 2012 Posted May 18, 2012 Anyone here knows how to put it on a website? I'm not using FluxCP just a simple CSS/PHP Website.
herenow Posted June 26, 2012 Posted June 26, 2012 OnPcLoginEvent: if(getusers(1) > $onlinerecord) { set $onlinerecord,getusers(1); } <?php mysql_connect('ip', 'user', 'password'); mysql_select_db('ragnarok_database'); $res = mysql_query("SELECT `value` FROM `mapreg` WHERE `index` = 0 AND `str` = '$onlinerecord' LIMIT 1"); $res= mysql_fetch_row($res); echo 'Record online:'. $res; ?> The rest is up to you.
Reducto Posted June 26, 2012 Author Posted June 26, 2012 Thanks a lot. All I need is to create a table right?
herenow Posted June 26, 2012 Posted June 26, 2012 All you need is to echo the $res in the website, and configure the : mysql_connect('ip', 'user', 'password'); mysql_select_db('ragnarok_database'); AND put that npc script in the server.
Reducto Posted June 26, 2012 Author Posted June 26, 2012 I'm having errors. Can you help me? Notice: Undefined variable: onlinerecord in C:\xampp\htdocs\EscapedRO\indexbackup.php on line 4 Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\EscapedRO\indexbackup.php on line 5 Record online:
herenow Posted June 26, 2012 Posted June 26, 2012 (edited) Ops.. Try this code. <?php mysql_connect('ip', 'user', 'password'); mysql_select_db('ragnarok_database'); $res = mysql_query('SELECT `value` FROM `mapreg` WHERE `index` = 0 AND `str` = \'$onlinerecord\' LIMIT 1'); $res = mysql_fetch_row($res); echo 'Record online:'. $res; ?> Edited June 26, 2012 by Tribbiani
Reducto Posted June 27, 2012 Author Posted June 27, 2012 One more error... Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\EscapedRO\indexbackup.php on line 5 Record online:
herenow Posted June 27, 2012 Posted June 27, 2012 (edited) One more error... Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\EscapedRO\indexbackup.php on line 5 Record online: kinda rusty here.. anyways.. use this... it was varname not str ><. <?php mysql_connect('ip', 'user', 'password'); mysql_select_db('ragnarok_database'); $res = mysql_query('SELECT `value` FROM `mapreg` WHERE `index` = 0 AND `varname` = \'$RecordOnline\' LIMIT 1'); $res = mysql_fetch_row($res); echo 'Record online:'. $res[0]; ?> Edited June 27, 2012 by Tribbiani
Question
Reducto
Anyone here knows how to put it on a website? I'm not using FluxCP just a simple CSS/PHP Website.
9 answers to this question
Recommended Posts