/** * @fn function query($query) * @brief * @file db.php * * @param query * @return */ public function query($query) { $res = mysql_query($query); if (!$res) { error::ErrorSQL("Erreur base sql", $query); } if (is_resource($res)) { $ret = new stdClass(); $ret->count = mysql_num_rows($res); $ret->query = $res; $ret->rows = array(); $i = 0; while ($resultat = mysql_fetch_assoc($res)) { $ret->rows[$i] = $resultat; $i++; } $ret->row = isset($ret->rows[0]) ? $ret->rows[0] : array(); return $ret; } return true; }