Note that there are some explanatory texts on larger screens.

plurals
  1. POphp , mysql not allowed to connect to static function
    text
    copied!<p>I have a strange problem and not satisfied with the resolution i got from my webhost.</p> <p>firstly i have backend system which runs php and was working fine till today. the system stopped adding some info to the mysql db , and upon investigation , i found that it was not running a static function which is was calling . </p> <p>the server log error :</p> <blockquote> <p>[25-Nov-2013 13:34:31 Africa/Johannesburg] PHP Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/1130): Host '197.242.74.19' is not allowed to connect to this MySQL server in /home/chamdorf/public_html/testsite/libs/config.php on line 72</p> <p>[25-Nov-2013 13:34:31 Africa/Johannesburg] PHP Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in /home/chamdorf/public_html/testsite/rwdsa/catalogue/mptt.php on line 137</p> <p>[25-Nov-2013 13:34:31 Africa/Johannesburg] PHP Fatal error: Call to a member function fetch_assoc() on a non-object in /home/chamdorf/public_html/testsite/rwdsa/catalogue/mptt.php on line 139</p> </blockquote> <p>funny part is this was working perfectly fine . wokrking with webhost , we changed in my connection string from chamdorfaktrysales.co.za to localhost and now it works fine .</p> <p>with the host as chamdorfaktrysales.co.za , the site works fine only gives and error when i do this :</p> <p>its mvc so this is basically the page im calling </p> <pre><code>function rebuild_tree() { mptt::rebuild_tree('1',1); return $this-&gt;Data; } static function rebuild_tree($parent_id, $left) { //init and get db connection from self $a = new mptt(); $db = $a-&gt;DBopen; // the right value of this node is the left value + 1 $right = $left+1; // get all children of this node $query_node = $db-&gt;query("SELECT CategoryID FROM categories WHERE ParentID = '$parent_id' "); while ($row = $query_node-&gt;fetch_assoc()) { // recursive execution of this function for each // child of this node // $right is the current right value, which is // incremented by the rebuild_tree function $right = mptt::rebuild_tree($row['CategoryID'], $right); } // we've got the left value, and now that we've processed // the children of this node we also know the right value $db-&gt;query("UPDATE categories SET lft='$left', rgt='$right' WHERE CategoryID='$parent_id' "); // return the right value of this node + 1 return $right+1; } </code></pre> <p>any ideas on what the issue could be ? Webhost might have made changes ? any help , ideas appreciated , Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload