Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ..Connections\oConn.php on line 31
Tengo una clase para crear la conexion a la BD de mysql
las 2 funciones principales son estas
Código PHP:
private function query($query){
$this->queryVar = $query;
$this->oConn = mysql_pconnect($this->hostname_oConn, $this->username_oConn, $this->password_oConn) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($this->database_oConn, $this->oConn);
$this->fetchArray($this->queryVar);
mysql_close($this->oConn);
return $this->resultArray;
}
private function fetchArray($query){
$resultado = mysql_query($query, $this->oConn);
while ($fila = mysql_fetch_array($resultado, MYSQL_ASSOC)){
$this->resultArray[] = $fila;
}
}
public function readissues(){
return $this->query("SELECT * FROM issues ORDER BY id ASC ");
}
Código PHP:
$issue = new connection();
$result=$issue->readissues();