thebobby Posted December 2, 2010 Share Posted December 2, 2010 i have a problem with my new cons they only work if i manually do them. thay all come up with errors like these Notice: Undefined property: User::$speedoffense in /home/mafiasfi/public_html/classes.php on line 740 Notice: Undefined property: User::$speedoffense in /home/mafiasfi/public_html/classes.php on line 742 Notice: Undefined index: ban in /home/mafiasfi/public_html/classes.php on line 792 Notice: Undefined index: lastchase in /home/mafiasfi/public_html/classes.php on line 928 Notice: Undefined index: pet in /home/mafiasfi/public_html/classes.php on line 979 Notice: Undefined index: cost in /home/mafiasfi/public_html/classes.php on line 991 Notice: Undefined index: friends in /home/mafiasfi/public_html/classes.php on line 1007 Notice: Undefined index: enemys in /home/mafiasfi/public_html/classes.php on line 1009 Notice: Undefined index: sbban in /home/mafiasfi/public_html/classes.php on line 1013 Quote Link to comment Share on other sites More sharing options...
Kieran-R Posted December 2, 2010 Share Posted December 2, 2010 How are we supposed to fix it if we cant see the code? Quote Link to comment Share on other sites More sharing options...
Equinox Posted December 2, 2010 Share Posted December 2, 2010 You need to turn error_reporting off. Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 2, 2010 Author Share Posted December 2, 2010 and that is in cpanel Quote Link to comment Share on other sites More sharing options...
Kieran-R Posted December 2, 2010 Share Posted December 2, 2010 put this below <?php : error_reporting(0); Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 2, 2010 Author Share Posted December 2, 2010 sorry but where i am not very script smart Quote Link to comment Share on other sites More sharing options...
Equinox Posted December 2, 2010 Share Posted December 2, 2010 In a globals file, something that is included on every page Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 2, 2010 Author Share Posted December 2, 2010 <? include 'dbcon.php'; include 'classes.php'; $randN = rand(1,25); $ng = mysql_query("SELECT * FROM numbergame WHERE number = {$randN} LIMIT 1") or mysql_error(); $g = mysql_fetch_array($ng); Send_Event($g['userid'],"<font color=green>Congratulations, You have won 25 points in the number game!</font>"); mysql_query("UPDATE `grpgusers` SET `points` = `points` + 25 WHERE `id` = '{$g['userid']}' LIMIT 1") or mysql_error(); mysql_query("UPDATE `numbergame` SET `userid` = 0") or mysql_error(); Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 2, 2010 Author Share Posted December 2, 2010 hour cron <? include 'dbcon.php'; include 'classes.php'; $randN = rand(1,25); $ng = mysql_query("SELECT * FROM numbergame WHERE number = {$randN} LIMIT 1") or mysql_error(); $g = mysql_fetch_array($ng); Send_Event($g['userid'],"<font color=green>Congratulations, You have won 25 points in the number game!</font>"); mysql_query("UPDATE `grpgusers` SET `points` = `points` + 25 WHERE `id` = '{$g['userid']}' LIMIT 1") or mysql_error(); mysql_query("UPDATE `numbergame` SET `userid` = 0") or mysql_error(); // kill of the hour $kf = mysql_query("SELECT * FROM `grpgusers` ORDER BY `hkills` DESC LIMIT 1") or mysql_error(); $kh = mysql_fetch_array($kf); $kill_class = new User($kh['id']); $amountofkills = $kh['hkills']; $killsid = $kh['id']; $reskill = "0"; Send_Event($killsid,"<font color=orange>Congratulations, You are the mobster of the hour and won 100 points!</font>"); mysql_query("UPDATE `grpgusers` SET `points` = `points` + 100, `hkills` = '$reskill' WHERE `id` = '{$kh['id']}' LIMIT 1") or mysql_error(); $inskills= mysql_query("INSERT INTO `hourfame` (`who`, `kills`)". "VALUES ('$killsid', '$amountofkills')") or mysql_error(); $resetthekills= mysql_query("UPDATE `grpgusers` SET `hkills` = 0") or mysql_error(); //other stuff $result = mysql_query("SELECT * FROM `grpgusers`"); $line = mysql_fetch_array($result, MYSQL_ASSOC); $updates_user = new User($line['id']); $result3 = mysql_query("SELECT*FROM `gangs` WHERE `crimetime` > '0'"); $worked3 = mysql_fetch_array($result3); $updates_gang = new Gang($worked3['id']); $newfreezehrs = $updates_user->freezehrs - 1; $newfreezehrs = ($newfreezehrs < 0) ? 0 : $newfreezehrs; $newmailbanhrs = $updates_user->mailbanhrs - 1; $newmailbanhrs = ($newmailbanhrs < 0) ? 0 : $newmailbanhrs; $newforumbanhrs = $updates_user->forumbanhrs - 1; $newforumbanhrs = ($newforumbanhrs < 0) ? 0 : $newforumbanhrs; $newgangcrime = $updates_gang->time - 1; $result = mysql_query("UPDATE `grpgusers` SET `sbbanhrs`='".$newsbbanhrs."', `forumbanhrs`='".$newforumbanhrs."', `mailbanhrs`='".$newmailbanhrs."', `freezehrs`='".$newfreezehrs."' WHERE `id`='".$updates_user->id."'"); $result = mysql_query("UPDATE `gangs` SET `crimetime`='".$newgangcrime."' WHERE `crimetime`!='0'"); ?> Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 2, 2010 Author Share Posted December 2, 2010 actually my update for refill bars and number game Quote Link to comment Share on other sites More sharing options...
Equinox Posted December 2, 2010 Share Posted December 2, 2010 In dbcon.php, under <?php add error_reporting(0); Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 2, 2010 Author Share Posted December 2, 2010 this is db php <? $conn = mysql_connect("localhost","mafiasti_loot","123xyz"); $db = mysql_select_db("mafiasti_grpg"); ?> Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 2, 2010 Author Share Posted December 2, 2010 part of database.php //Function to handle database errors. function db_error($query, $errno, $error) { die('<font color="#000000">' . $errno . ' - ' . $error . ' Â ' . $query . ' Â <font color="#ff0000">[sTOP]</font> Â </font>'); } //Function to query the database. function db_query($query, $link = 'db_link') { global $$link; $result = mysql_query($query, $$link) or db_error($query, mysql_errno(), mysql_error()); return $result; Quote Link to comment Share on other sites More sharing options...
Dominion Posted December 2, 2010 Share Posted December 2, 2010 Ok... First they are saying do this - <?php error_reporting(0); $conn = mysql_connect("localhost","mafiasti_loot","123xyz"); $db = mysql_select_db("mafiasti_grpg"); ?> Second – Please use the bbcode tags to post code so for php – [.php] Code here [./php] Without the dots. Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 2, 2010 Author Share Posted December 2, 2010 ok thats done so how long do i wait to see if it is working Quote Link to comment Share on other sites More sharing options...
Dominion Posted December 2, 2010 Share Posted December 2, 2010 ok thats done so how long do i wait to see if it is working Go test it then you don't need to wait. ;) Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 2, 2010 Author Share Posted December 2, 2010 errors gone from crons but still not working any ideas Quote Link to comment Share on other sites More sharing options...
Dominion Posted December 2, 2010 Share Posted December 2, 2010 errors gone from crons but still not working any ideas Well it wouldn’t all you did was turned error reporting off. As originally, stated Post the cron file so we can look. Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 2, 2010 Author Share Posted December 2, 2010 hour cron posted how u post that php source code all i know is to copy and paste it here for refills on bars Quote Link to comment Share on other sites More sharing options...
URBANZ Posted December 3, 2010 Share Posted December 3, 2010 i would say your missing values in your classes file so update.php can update them as they are not there to update Quote Link to comment Share on other sites More sharing options...
Djkanna Posted December 3, 2010 Share Posted December 3, 2010 PHP notifies you for a reason you shouldn't just take the quick route out and turn off error_reporting(). Quote Link to comment Share on other sites More sharing options...
Equinox Posted December 3, 2010 Share Posted December 3, 2010 Yes, because with it on he will clearly be able to fix it. :P Quote Link to comment Share on other sites More sharing options...
Kieran-R Posted December 3, 2010 Share Posted December 3, 2010 Post the crons you have running on your cPanel. If you are not using curl, then thats why. Quote Link to comment Share on other sites More sharing options...
thebobby Posted December 9, 2010 Author Share Posted December 9, 2010 they r on cpanel they show on server as working but not on game as if i manually click on them in internet browser they work Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.