php - File returns no errors, but doesn't work as expected -


i tried convert php file mysql mysqli because wanted use same server in future php version, doesnt work anymore. changed should functions don't work anymore. returns no error?. here file, big. how can see whats wrong file when there no errors or syntax highligting shows whats wrong?

    ob_start();   class database {      var $connection = null;      function connect($host, $user, $pass, $name) {          $error = false;           $this->connection = ($globals["___mysqli_ston"] = mysqli_connect($host,  $user,  $pass)) or $error = true;          ((bool)mysqli_query( $this->connection, "use $name")) or $error = true;           return !$error;      }       function executequery($query) {          return mysqli_query($globals["___mysqli_ston"], $query);      }       function executefetch($result) {          return mysqli_fetch_assoc($result);      }       function executefetchquery($query) {          $result = mysqli_query($globals["___mysqli_ston"], $query);          return mysqli_fetch_assoc($result);      }       function numrows($result) {          return mysqli_num_rows($result);      }       function escape($string) {           if(get_magic_quotes_runtime()) $string = stripslashes($string);           return @mysqli_real_escape_string( $this->connection, $string);       }       function insert($table, $data) {          $query = "insert " . $table . " ";          $v = ""; $n = "";            foreach($data $key=>$val) {              $n .=  $key . ", ";               if(strtolower($val) == "null") {                  $v .= "null, ";              } elseif(strtolower($val) == "now()") {                  $v .= "now(), ";              } else {                  $v .= "'" . $this->escape($val) . "', ";              }          }           $query .= "(" . rtrim($n, ', ') . ") values (" . rtrim($v, ', ') . ");";           $this->executequery($query);      }       function close() {          if($this->connected()) {              ((is_null($___mysqli_res = mysqli_close($this->connection))) ? false : $___mysqli_res);          }      }       function connected() {          if($this->connection != null) {              return true;          } else {              return false;          }      }  }      


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -