Fatal error mysql.php

Συζητήσεις για την βάση δεδομένων MySQL και το phpMyAdmin

Συντονιστές: WebDev Moderators, Super-Moderators

Απάντηση
Άβαταρ μέλους
fiskilis
Honorary Member
Δημοσιεύσεις: 14095
Εγγραφή: 16 Νοέμ 2003 22:44
Τοποθεσία: Athens
Επικοινωνία:

Fatal error mysql.php

Δημοσίευση από fiskilis » 05 Νοέμ 2011 14:19

καποιες φορες περνω αυτο το μηνυμα στο http://bno.gr οταν φορτωνει
ξερει καποιος τι συμβαινει;

μηπως πρεπει να μιλησω με τον server;
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 131072 bytes) in /home/bnogr/public_html/libraries/joomla/database/database/mysql.php on line 466

gvre
Δημοσιεύσεις: 990
Εγγραφή: 14 Οκτ 2010 11:34
Τοποθεσία: Ηράκλειο Κρήτης
Επικοινωνία:

Fatal error mysql.php

Δημοσίευση από gvre » 05 Νοέμ 2011 14:53

Προσπαθεί να δεσμεύσει περισσότερη μνήμη από την επιτρεπόμενη (περίπου 40ΜΒ). Τι κώδικα έχει το αρχείο mysql.php στη γραμμή 466;

Άβαταρ μέλους
fiskilis
Honorary Member
Δημοσιεύσεις: 14095
Εγγραφή: 16 Νοέμ 2003 22:44
Τοποθεσία: Athens
Επικοινωνία:

Fatal error mysql.php

Δημοσίευση από fiskilis » 05 Νοέμ 2011 15:18

αυτος ειναι ο κωδικας
πως βρισκεις την γραμμη 466;
και αν μεγαλωσω την τιμη θα συνελθει;
τι μπορει ξαφνικα να το προκαλεσε αυτο;

(βρηκα δυο αναφορες MYSQL40 και το εκανα 50 με δοκιμες εδειξε οτι παει καλα, ειναι σωστο αυτο που εκανα;)

Κώδικας: Επιλογή όλων

<?php
/**
* @version		$Id&#58; mysql.php 16385 2010-04-23 10&#58;44&#58;15Z ian $
* @package		Joomla.Framework
* @subpackage	Database
* @copyright	Copyright &#40;C&#41; 2005 - 2010 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Check to ensure this file is within the rest of the framework
defined&#40;'JPATH_BASE'&#41; or die&#40;&#41;;

/**
 * MySQL database driver
 *
 * @package		Joomla.Framework
 * @subpackage	Database
 * @since		1.0
 */
class JDatabaseMySQL extends JDatabase
&#123;
	/**
	 * The database driver name
	 *
	 * @var string
	 */
	var $name			= 'mysql';

	/**
	 *  The null/zero date string
	 *
	 * @var string
	 */
	var $_nullDate		= '0000-00-00 00&#58;00&#58;00';

	/**
	 * Quote for named objects
	 *
	 * @var string
	 */
	var $_nameQuote		= '`';

	/**
	* Database object constructor
	*
	* @access	public
	* @param	array	List of options used to configure the connection
	* @since	1.5
	* @see		JDatabase
	*/
	function __construct&#40; $options &#41;
	&#123;
		$host		= array_key_exists&#40;'host', $options&#41;	? $options&#91;'host'&#93;		&#58; 'localhost';
		$user		= array_key_exists&#40;'user', $options&#41;	? $options&#91;'user'&#93;		&#58; '';
		$password	= array_key_exists&#40;'password',$options&#41;	? $options&#91;'password'&#93;	&#58; '';
		$database	= array_key_exists&#40;'database',$options&#41;	? $options&#91;'database'&#93;	&#58; '';
		$prefix		= array_key_exists&#40;'prefix', $options&#41;	? $options&#91;'prefix'&#93;	&#58; 'jos_';
		$select		= array_key_exists&#40;'select', $options&#41;	? $options&#91;'select'&#93;	&#58; true;

		// perform a number of fatality checks, then return gracefully
		if &#40;!function_exists&#40; 'mysql_connect' &#41;&#41; &#123;
			$this->_errorNum = 1;
			$this->_errorMsg = 'The MySQL adapter "mysql" is not available.';
			return;
		&#125;

		// connect to the server
		if &#40;!&#40;$this->_resource = @mysql_connect&#40; $host, $user, $password, true &#41;&#41;&#41; &#123;
			$this->_errorNum = 2;
			$this->_errorMsg = 'Could not connect to MySQL';
			return;
		&#125;

		// finalize initialization
		parent&#58;&#58;__construct&#40;$options&#41;;

		// select the database
		if &#40; $select &#41; &#123;
			$this->select&#40;$database&#41;;
		&#125;
	&#125;

	/**
	 * Database object destructor
	 *
	 * @return boolean
	 * @since 1.5
	 */
	function __destruct&#40;&#41;
	&#123;
		$return = false;
		if &#40;is_resource&#40;$this->_resource&#41;&#41; &#123;
			$return = mysql_close&#40;$this->_resource&#41;;
		&#125;
		return $return;
	&#125;

	/**
	 * Test to see if the MySQL connector is available
	 *
	 * @static
	 * @access public
	 * @return boolean  True on success, false otherwise.
	 */
	function test&#40;&#41;
	&#123;
		return &#40;function_exists&#40; 'mysql_connect' &#41;&#41;;
	&#125;

	/**
	 * Determines if the connection to the server is active.
	 *
	 * @access	public
	 * @return	boolean
	 * @since	1.5
	 */
	function connected&#40;&#41;
	&#123;
		if&#40;is_resource&#40;$this->_resource&#41;&#41; &#123;
			return mysql_ping&#40;$this->_resource&#41;;
		&#125;
		return false;
	&#125;

	/**
	 * Select a database for use
	 *
	 * @access	public
	 * @param	string $database
	 * @return	boolean True if the database has been successfully selected
	 * @since	1.5
	 */
	function select&#40;$database&#41;
	&#123;
		if &#40; ! $database &#41;
		&#123;
			return false;
		&#125;

		if &#40; !mysql_select_db&#40; $database, $this->_resource &#41;&#41; &#123;
			$this->_errorNum = 3;
			$this->_errorMsg = 'Could not connect to database';
			return false;
		&#125;

		// if running mysql 5, set sql-mode to mysql40 - thereby circumventing strict mode problems
		if &#40; strpos&#40; $this->getVersion&#40;&#41;, '5' &#41; === 0 &#41; &#123;
			$this->setQuery&#40; "SET sql_mode = 'MYSQL40'" &#41;;
			$this->query&#40;&#41;;
		&#125;

		return true;
	&#125;

	/**
	 * Determines UTF support
	 *
	 * @access	public
	 * @return boolean True - UTF is supported
	 */
	function hasUTF&#40;&#41;
	&#123;
		$verParts = explode&#40; '.', $this->getVersion&#40;&#41; &#41;;
		return &#40;$verParts&#91;0&#93; == 5 || &#40;$verParts&#91;0&#93; == 4 && $verParts&#91;1&#93; == 1 && &#40;int&#41;$verParts&#91;2&#93; >= 2&#41;&#41;;
	&#125;

	/**
	 * Custom settings for UTF support
	 *
	 * @access	public
	 */
	function setUTF&#40;&#41;
	&#123;
		mysql_query&#40; "SET NAMES 'utf8'", $this->_resource &#41;;
	&#125;

	/**
	 * Get a database escaped string
	 *
	 * @param	string	The string to be escaped
	 * @param	boolean	Optional parameter to provide extra escaping
	 * @return	string
	 * @access	public
	 * @abstract
	 */
	function getEscaped&#40; $text, $extra = false &#41;
	&#123;
		$result = mysql_real_escape_string&#40; $text, $this->_resource &#41;;
		if &#40;$extra&#41; &#123;
			$result = addcslashes&#40; $result, '%_' &#41;;
		&#125;
		return $result;
	&#125;

	/**
	 * Execute the query
	 *
	 * @access	public
	 * @return mixed A database resource if successful, FALSE if not.
	 */
	function query&#40;&#41;
	&#123;
		if &#40;!is_resource&#40;$this->_resource&#41;&#41; &#123;
			return false;
		&#125;

		// Take a local copy so that we don't modify the original query and cause issues later
		$sql = $this->_sql;
		if &#40;$this->_limit > 0 || $this->_offset > 0&#41; &#123;
			$sql .= ' LIMIT ' . max&#40;$this->_offset, 0&#41; . ', ' . max&#40;$this->_limit, 0&#41;;
		&#125;
		if &#40;$this->_debug&#41; &#123;
			$this->_ticker++;
			$this->_log&#91;&#93; = $sql;
		&#125;
		$this->_errorNum = 0;
		$this->_errorMsg = '';
		$this->_cursor = mysql_query&#40; $sql, $this->_resource &#41;;

		if &#40;!$this->_cursor&#41;
		&#123;
			$this->_errorNum = mysql_errno&#40; $this->_resource &#41;;
			$this->_errorMsg = mysql_error&#40; $this->_resource &#41;." SQL=$sql";

			if &#40;$this->_debug&#41; &#123;
				JError&#58;&#58;raiseError&#40;500, 'JDatabaseMySQL&#58;&#58;query&#58; '.$this->_errorNum.' - '.$this->_errorMsg &#41;;
			&#125;
			return false;
		&#125;
		return $this->_cursor;
	&#125;

	/**
	 * Description
	 *
	 * @access	public
	 * @return int The number of affected rows in the previous operation
	 * @since 1.0.5
	 */
	function getAffectedRows&#40;&#41;
	&#123;
		return mysql_affected_rows&#40; $this->_resource &#41;;
	&#125;

	/**
	 * Execute a batch query
	 *
	 * @access	public
	 * @return mixed A database resource if successful, FALSE if not.
	 */
	function queryBatch&#40; $abort_on_error=true, $p_transaction_safe = false&#41;
	&#123;
		$this->_errorNum = 0;
		$this->_errorMsg = '';
		if &#40;$p_transaction_safe&#41; &#123;
			$this->_sql = rtrim&#40;$this->_sql, "; \t\r\n\0"&#41;;
			$si = $this->getVersion&#40;&#41;;
			preg_match_all&#40; "/&#40;\d+&#41;\.&#40;\d+&#41;\.&#40;\d+&#41;/i", $si, $m &#41;;
			if &#40;$m&#91;1&#93; >= 4&#41; &#123;
				$this->_sql = 'START TRANSACTION;' . $this->_sql . '; COMMIT;';
			&#125; else if &#40;$m&#91;2&#93; >= 23 && $m&#91;3&#93; >= 19&#41; &#123;
				$this->_sql = 'BEGIN WORK;' . $this->_sql . '; COMMIT;';
			&#125; else if &#40;$m&#91;2&#93; >= 23 && $m&#91;3&#93; >= 17&#41; &#123;
				$this->_sql = 'BEGIN;' . $this->_sql . '; COMMIT;';
			&#125;
		&#125;
		$query_split = $this->splitSql&#40;$this->_sql&#41;;
		$error = 0;
		foreach &#40;$query_split as $command_line&#41; &#123;
			$command_line = trim&#40; $command_line &#41;;
			if &#40;$command_line != ''&#41; &#123;
				$this->_cursor = mysql_query&#40; $command_line, $this->_resource &#41;;
				if &#40;$this->_debug&#41; &#123;
					$this->_ticker++;
					$this->_log&#91;&#93; = $command_line;
				&#125;
				if &#40;!$this->_cursor&#41; &#123;
					$error = 1;
					$this->_errorNum .= mysql_errno&#40; $this->_resource &#41; . ' ';
					$this->_errorMsg .= mysql_error&#40; $this->_resource &#41;." SQL=$command_line <br />";
					if &#40;$abort_on_error&#41; &#123;
						return $this->_cursor;
					&#125;
				&#125;
			&#125;
		&#125;
		return $error ? false &#58; true;
	&#125;

	/**
	 * Diagnostic function
	 *
	 * @access	public
	 * @return	string
	 */
	function explain&#40;&#41;
	&#123;
		$temp = $this->_sql;
		$this->_sql = "EXPLAIN $this->_sql";

		if &#40;!&#40;$cur = $this->query&#40;&#41;&#41;&#41; &#123;
			return null;
		&#125;
		$first = true;

		$buffer = '<table id="explain-sql">';
		$buffer .= '<thead><tr><td colspan="99">'.$this->getQuery&#40;&#41;.'</td></tr>';
		while &#40;$row = mysql_fetch_assoc&#40; $cur &#41;&#41; &#123;
			if &#40;$first&#41; &#123;
				$buffer .= '<tr>';
				foreach &#40;$row as $k=>$v&#41; &#123;
					$buffer .= '<th>'.$k.'</th>';
				&#125;
				$buffer .= '</tr>';
				$first = false;
			&#125;
			$buffer .= '</thead><tbody><tr>';
			foreach &#40;$row as $k=>$v&#41; &#123;
				$buffer .= '<td>'.$v.'</td>';
			&#125;
			$buffer .= '</tr>';
		&#125;
		$buffer .= '</tbody></table>';
		mysql_free_result&#40; $cur &#41;;

		$this->_sql = $temp;

		return $buffer;
	&#125;

	/**
	 * Description
	 *
	 * @access	public
	 * @return int The number of rows returned from the most recent query.
	 */
	function getNumRows&#40; $cur=null &#41;
	&#123;
		return mysql_num_rows&#40; $cur ? $cur &#58; $this->_cursor &#41;;
	&#125;

	/**
	 * This method loads the first field of the first row returned by the query.
	 *
	 * @access	public
	 * @return The value returned in the query or null if the query failed.
	 */
	function loadResult&#40;&#41;
	&#123;
		if &#40;!&#40;$cur = $this->query&#40;&#41;&#41;&#41; &#123;
			return null;
		&#125;
		$ret = null;
		if &#40;$row = mysql_fetch_row&#40; $cur &#41;&#41; &#123;
			$ret = $row&#91;0&#93;;
		&#125;
		mysql_free_result&#40; $cur &#41;;
		return $ret;
	&#125;

	/**
	 * Load an array of single field results into an array
	 *
	 * @access	public
	 */
	function loadResultArray&#40;$numinarray = 0&#41;
	&#123;
		if &#40;!&#40;$cur = $this->query&#40;&#41;&#41;&#41; &#123;
			return null;
		&#125;
		$array = array&#40;&#41;;
		while &#40;$row = mysql_fetch_row&#40; $cur &#41;&#41; &#123;
			$array&#91;&#93; = $row&#91;$numinarray&#93;;
		&#125;
		mysql_free_result&#40; $cur &#41;;
		return $array;
	&#125;

	/**
	* Fetch a result row as an associative array
	*
	* @access	public
	* @return array
	*/
	function loadAssoc&#40;&#41;
	&#123;
		if &#40;!&#40;$cur = $this->query&#40;&#41;&#41;&#41; &#123;
			return null;
		&#125;
		$ret = null;
		if &#40;$array = mysql_fetch_assoc&#40; $cur &#41;&#41; &#123;
			$ret = $array;
		&#125;
		mysql_free_result&#40; $cur &#41;;
		return $ret;
	&#125;

	/**
	* Load a assoc list of database rows
	*
	* @access	public
	* @param string The field name of a primary key
	* @return array If <var>key</var> is empty as sequential list of returned records.
	*/
	function loadAssocList&#40; $key='' &#41;
	&#123;
		if &#40;!&#40;$cur = $this->query&#40;&#41;&#41;&#41; &#123;
			return null;
		&#125;
		$array = array&#40;&#41;;
		while &#40;$row = mysql_fetch_assoc&#40; $cur &#41;&#41; &#123;
			if &#40;$key&#41; &#123;
				$array&#91;$row&#91;$key&#93;&#93; = $row;
			&#125; else &#123;
				$array&#91;&#93; = $row;
			&#125;
		&#125;
		mysql_free_result&#40; $cur &#41;;
		return $array;
	&#125;

	/**
	* This global function loads the first row of a query into an object
	*
	* @access	public
	* @return 	object
	*/
	function loadObject&#40; &#41;
	&#123;
		if &#40;!&#40;$cur = $this->query&#40;&#41;&#41;&#41; &#123;
			return null;
		&#125;
		$ret = null;
		if &#40;$object = mysql_fetch_object&#40; $cur &#41;&#41; &#123;
			$ret = $object;
		&#125;
		mysql_free_result&#40; $cur &#41;;
		return $ret;
	&#125;

	/**
	* Load a list of database objects
	*
	* If <var>key</var> is not empty then the returned array is indexed by the value
	* the database key.  Returns <var>null</var> if the query fails.
	*
	* @access	public
	* @param string The field name of a primary key
	* @return array If <var>key</var> is empty as sequential list of returned records.
	*/
	function loadObjectList&#40; $key='' &#41;
	&#123;
		if &#40;!&#40;$cur = $this->query&#40;&#41;&#41;&#41; &#123;
			return null;
		&#125;
		$array = array&#40;&#41;;
		while &#40;$row = mysql_fetch_object&#40; $cur &#41;&#41; &#123;
			if &#40;$key&#41; &#123;
				$array&#91;$row->$key&#93; = $row;
			&#125; else &#123;
				$array&#91;&#93; = $row;
			&#125;
		&#125;
		mysql_free_result&#40; $cur &#41;;
		return $array;
	&#125;

	/**
	 * Description
	 *
	 * @access	public
	 * @return The first row of the query.
	 */
	function loadRow&#40;&#41;
	&#123;
		if &#40;!&#40;$cur = $this->query&#40;&#41;&#41;&#41; &#123;
			return null;
		&#125;
		$ret = null;
		if &#40;$row = mysql_fetch_row&#40; $cur &#41;&#41; &#123;
			$ret = $row;
		&#125;
		mysql_free_result&#40; $cur &#41;;
		return $ret;
	&#125;

	/**
	* Load a list of database rows &#40;numeric column indexing&#41;
	*
	* @access public
	* @param string The field name of a primary key
	* @return array If <var>key</var> is empty as sequential list of returned records.
	* If <var>key</var> is not empty then the returned array is indexed by the value
	* the database key.  Returns <var>null</var> if the query fails.
	*/
	function loadRowList&#40; $key=null &#41;
	&#123;
		if &#40;!&#40;$cur = $this->query&#40;&#41;&#41;&#41; &#123;
			return null;
		&#125;
		$array = array&#40;&#41;;
		while &#40;$row = mysql_fetch_row&#40; $cur &#41;&#41; &#123;
			if &#40;$key !== null&#41; &#123;
				$array&#91;$row&#91;$key&#93;&#93; = $row;
			&#125; else &#123;
				$array&#91;&#93; = $row;
			&#125;
		&#125;
		mysql_free_result&#40; $cur &#41;;
		return $array;
	&#125;

	/**
	 * Inserts a row into a table based on an objects properties
	 *
	 * @access	public
	 * @param	string	The name of the table
	 * @param	object	An object whose properties match table fields
	 * @param	string	The name of the primary key. If provided the object property is updated.
	 */
	function insertObject&#40; $table, &$object, $keyName = NULL &#41;
	&#123;
		$fmtsql = 'INSERT INTO '.$this->nameQuote&#40;$table&#41;.' &#40; %s &#41; VALUES &#40; %s &#41; ';
		$fields = array&#40;&#41;;
		foreach &#40;get_object_vars&#40; $object &#41; as $k => $v&#41; &#123;
			if &#40;is_array&#40;$v&#41; or is_object&#40;$v&#41; or $v === NULL&#41; &#123;
				continue;
			&#125;
			if &#40;$k&#91;0&#93; == '_'&#41; &#123; // internal field
				continue;
			&#125;
			$fields&#91;&#93; = $this->nameQuote&#40; $k &#41;;
			$values&#91;&#93; = $this->isQuoted&#40; $k &#41; ? $this->Quote&#40; $v &#41; &#58; &#40;int&#41; $v;
		&#125;
		$this->setQuery&#40; sprintf&#40; $fmtsql, implode&#40; ",", $fields &#41; ,  implode&#40; ",", $values &#41; &#41; &#41;;
		if &#40;!$this->query&#40;&#41;&#41; &#123;
			return false;
		&#125;
		$id = $this->insertid&#40;&#41;;
		if &#40;$keyName && $id&#41; &#123;
			$object->$keyName = $id;
		&#125;
		return true;
	&#125;

	/**
	 * Description
	 *
	 * @access public
	 * @param &#91;type&#93; $updateNulls
	 */
	function updateObject&#40; $table, &$object, $keyName, $updateNulls=true &#41;
	&#123;
		$fmtsql = 'UPDATE '.$this->nameQuote&#40;$table&#41;.' SET %s WHERE %s';
		$tmp = array&#40;&#41;;
		foreach &#40;get_object_vars&#40; $object &#41; as $k => $v&#41;
		&#123;
			if&#40; is_array&#40;$v&#41; or is_object&#40;$v&#41; or $k&#91;0&#93; == '_' &#41; &#123; // internal or NA field
				continue;
			&#125;
			if&#40; $k == $keyName &#41; &#123; // PK not to be updated
				$where = $keyName . '=' . $this->Quote&#40; $v &#41;;
				continue;
			&#125;
			if &#40;$v === null&#41;
			&#123;
				if &#40;$updateNulls&#41; &#123;
					$val = 'NULL';
				&#125; else &#123;
					continue;
				&#125;
			&#125; else &#123;
				$val = $this->isQuoted&#40; $k &#41; ? $this->Quote&#40; $v &#41; &#58; &#40;int&#41; $v;
			&#125;
			$tmp&#91;&#93; = $this->nameQuote&#40; $k &#41; . '=' . $val;
		&#125;
		$this->setQuery&#40; sprintf&#40; $fmtsql, implode&#40; ",", $tmp &#41; , $where &#41; &#41;;
		return $this->query&#40;&#41;;
	&#125;

	/**
	 * Description
	 *
	 * @access public
	 */
	function insertid&#40;&#41;
	&#123;
		return mysql_insert_id&#40; $this->_resource &#41;;
	&#125;

	/**
	 * Description
	 *
	 * @access public
	 */
	function getVersion&#40;&#41;
	&#123;
		return mysql_get_server_info&#40; $this->_resource &#41;;
	&#125;

	/**
	 * Assumes database collation in use by sampling one text field in one table
	 *
	 * @access	public
	 * @return string Collation in use
	 */
	function getCollation &#40;&#41;
	&#123;
		if &#40; $this->hasUTF&#40;&#41; &#41; &#123;
			$this->setQuery&#40; 'SHOW FULL COLUMNS FROM #__content' &#41;;
			$array = $this->loadAssocList&#40;&#41;;
			return $array&#91;'4'&#93;&#91;'Collation'&#93;;
		&#125; else &#123;
			return "N/A &#40;mySQL < 4.1.2&#41;";
		&#125;
	&#125;

	/**
	 * Description
	 *
	 * @access	public
	 * @return array A list of all the tables in the database
	 */
	function getTableList&#40;&#41;
	&#123;
		$this->setQuery&#40; 'SHOW TABLES' &#41;;
		return $this->loadResultArray&#40;&#41;;
	&#125;

	/**
	 * Shows the CREATE TABLE statement that creates the given tables
	 *
	 * @access	public
	 * @param 	array|string 	A table name or a list of table names
	 * @return 	array A list the create SQL for the tables
	 */
	function getTableCreate&#40; $tables &#41;
	&#123;
		settype&#40;$tables, 'array'&#41;; //force to array
		$result = array&#40;&#41;;

		foreach &#40;$tables as $tblval&#41; &#123;
			$this->setQuery&#40; 'SHOW CREATE table ' . $this->getEscaped&#40; $tblval &#41; &#41;;
			$rows = $this->loadRowList&#40;&#41;;
			foreach &#40;$rows as $row&#41; &#123;
				$result&#91;$tblval&#93; = $row&#91;1&#93;;
			&#125;
		&#125;

		return $result;
	&#125;

	/**
	 * Retrieves information about the given tables
	 *
	 * @access	public
	 * @param 	array|string 	A table name or a list of table names
	 * @param	boolean			Only return field types, default true
	 * @return	array An array of fields by table
	 */
	function getTableFields&#40; $tables, $typeonly = true &#41;
	&#123;
		settype&#40;$tables, 'array'&#41;; //force to array
		$result = array&#40;&#41;;

		foreach &#40;$tables as $tblval&#41;
		&#123;
			$this->setQuery&#40; 'SHOW FIELDS FROM ' . $tblval &#41;;
			$fields = $this->loadObjectList&#40;&#41;;

			if&#40;$typeonly&#41;
			&#123;
				foreach &#40;$fields as $field&#41; &#123;
					$result&#91;$tblval&#93;&#91;$field->Field&#93; = preg_replace&#40;"/&#91;&#40;0-9&#41;&#93;/",'', $field->Type &#41;;
				&#125;
			&#125;
			else
			&#123;
				foreach &#40;$fields as $field&#41; &#123;
					$result&#91;$tblval&#93;&#91;$field->Field&#93; = $field;
				&#125;
			&#125;
		&#125;

		return $result;
	&#125;
&#125;

gvre
Δημοσιεύσεις: 990
Εγγραφή: 14 Οκτ 2010 11:34
Τοποθεσία: Ηράκλειο Κρήτης
Επικοινωνία:

Fatal error mysql.php

Δημοσίευση από gvre » 05 Νοέμ 2011 16:32

Κώδικας: Επιλογή όλων

function loadObjectList&#40; $key='' &#41;
   &#123;
      if &#40;!&#40;$cur = $this->query&#40;&#41;&#41;&#41; &#123;
         return null;
      &#125;
      $array = array&#40;&#41;;
      while &#40;$row = mysql_fetch_object&#40; $cur &#41;&#41; &#123;
         if &#40;$key&#41; &#123;
            $array&#91;$row->$key&#93; = $row;
         &#125; else &#123;
            $array&#91;&#93; = $row; // <------------ γραμμή 466
         &#125;
      &#125;
      mysql_free_result&#40; $cur &#41;;
      return $array;
   &#125;

Εδώ μάλλον προσπαθεί να φορτώσει αρκετά objects και δεν του αρκεί η διαθέσιμη μνήμη (που έχει οριστεί στο php.ini).
Αν μπορείς, πέρασέ το σε κάποιον dev server και βάλε το xdebug. Μόλις πετάξει το ίδιο error, θα πάρεις ένα stack trace το οποίο έχει αρκετά χρήσιμες πληροφορίες.

Μην ξεχάσεις να ορίσεις το memory_limit ίσο με αυτό του server που έχεις το site.

ps. Τη γραμμή 466, σε vim που χρησιμοποιώ εγώ, τη βρίσκεις με :466 ή vim mysql.php +466 :)

Άβαταρ μέλους
fiskilis
Honorary Member
Δημοσιεύσεις: 14095
Εγγραφή: 16 Νοέμ 2003 22:44
Τοποθεσία: Athens
Επικοινωνία:

Fatal error mysql.php

Δημοσίευση από fiskilis » 05 Νοέμ 2011 17:49

δεν καταλαβα απολυτως τιποτα ιδεα δεν εχω απο αυτα που λες
o σερβερ μου αυξησε το οριο αλλα λεει πρεπει να φταιξω το προβλημα
αν βγαλω ερκετα modules που φορτωνει το joomla λες να λυθει το προλβημα;

gvre
Δημοσιεύσεις: 990
Εγγραφή: 14 Οκτ 2010 11:34
Τοποθεσία: Ηράκλειο Κρήτης
Επικοινωνία:

Fatal error mysql.php

Δημοσίευση από gvre » 06 Νοέμ 2011 01:55

Ίσως. Σε κάθε περίπτωση καλό είναι να μην έχεις modules που δε χρησιμοποιείς. Δοκίμασε να βγάλεις ό,τι δε χρειάζεσαι και δες αν διορθώνεται το πρόβλημα.

Απάντηση

Επιστροφή στο “MySQL”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες