[TYPO3-german] mysql_fetch_assoc(): supplied argument is not a valid MySQL

Ramon Berndt ramon.berndt at googlemail.com
Fri Feb 13 08:46:40 CET 2009


Wenns nervt, aber keine funktionale Beeinträchtigung nach sich zieht, kannst
du PHP-Warnmeldungen im Install-Tool auch abschalten. Nach dem Motto:
Bekämpfe das Resultat ignoriere die Ursache ;)

Ne, im Ernst, folgende Funktionen verursachen die Warnmeldungen:

	/**
	 * Returns information about each field in the $table (quering the DBMS)
	 * In a DBAL this should look up the right handler for the table and
return compatible information
	 * This function is important not only for the Install Tool but
probably for DBALs as well since they might need to look up table
specific information in order to construct correct queries. In such
cases this information should probably be cached for quick delivery.
	 *
	 * @param	string		Table name
	 * @return	array		Field information in an associative array with
fieldname => field row
	 */
	function admin_get_fields($tableName)	{
		$output = array <http://www.php.net/array>();

		$columns_res = mysql_query <http://www.php.net/mysql_query>('SHOW
COLUMNS FROM `'.$tableName.'`', $this->link);
		while($fieldRow = mysql_fetch_assoc
<http://www.php.net/mysql_fetch_assoc>($columns_res))	{
			$output[$fieldRow['Field']] = $fieldRow;
		}

		return $output;
	}

	/**
	 * Returns information about each index key in the $table (quering the DBMS)
	 * In a DBAL this should look up the right handler for the table and
return compatible information
	 *
	 * @param	string		Table name
	 * @return	array		Key information in a numeric array
	 */
	function admin_get_keys($tableName)	{
		$output = array <http://www.php.net/array>();

		$keyRes = mysql_query <http://www.php.net/mysql_query>('SHOW KEYS
FROM `'.$tableName.'`', $this->link);
		while($keyRow = mysql_fetch_assoc
<http://www.php.net/mysql_fetch_assoc>($keyRes))	{
			$output[] = $keyRow;
		}

		return $output;
	}

Beide Male schlägt der mysql_query fehl. Möglich, dass $tableName eine
Tabelle enthält, die nicht vorhanden ist. Ich würde mal ein "echo
$tableName<br/>" nach dem mysql_query setzen, um zu sehen, welche Tabellen
anscheinend nicht vorhanden sind (oder falsch benannt). Vergleiche einfach
die ausgegebenen Tabellennamen mal mit denen in deiner Datenbank.

Am 12. Februar 2009 20:40 schrieb Thomas Hirt <info at thomas-hirt.at>:

> Danke für die Anregungen.
> Leider habe ich das Problem bis jetzt nicht lösen können.
>
> Hingegen ist ein Ähnlicher Fehler bei einer Typo3 4.1.10 Installation
> aufgetaucht:
>
> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result
> resource in
> /argvgtxb/www.argeschoepfung.at/typo3_src-4.1.10/t3lib/class.t3lib_db.phpon line 995
>
> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result
> resource in
> /argvgtxb/www.argeschoepfung.at/typo3_src-4.1.10/t3lib/class.t3lib_db.phpon line 1013
>
> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result
> resource in
> /argvgtxb/www.argeschoepfung.at/typo3_src-4.1.10/t3lib/class.t3lib_db.phpon line 995
>
> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result
> resource in
> /argvgtxb/www.argeschoepfung.at/typo3_src-4.1.10/t3lib/class.t3lib_db.phpon line 1013
>
> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result
> resource in
> /argvgtxb/www.argeschoepfung.at/typo3_src-4.1.10/t3lib/class.t3lib_db.phpon line 995
>
> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result
> resource in
> /argvgtxb/www.argeschoepfung.at/typo3_src-4.1.10/t3lib/class.t3lib_db.phpon line 1013
>
> Hat das noch nie wer gesehen?
> Falls jemand etwas ähnliches im Extension Manager zu lesen bekommt oder
> Abhilfe weiß, bitte melden.
>
> Dankeim Voraus und Liebe Grüße,
> Thomas
>
> Thomas Hirt schrieb:
> > Wo soll ich das einstellen?
> > Im Install Tool?
> >
> >  >mySQL-Server im Debugmode?
> >
> > Mir ist noch was aufgefallen.
> > Bei den Extensions steht auch: A difference between the originally
> > installed version and the current was detected!
> >
> > Habe abe sicher nichts verändert...
> >
> > Sehr seltsam,
> > bin für jeden Tipp dankbar,
> >
> > Thomas
> >
> >
> >
> > Rainer Schleevoigt schrieb:
> >> Thomas Hirt schrieb:
> >>> Hi!
> >>> Habe das Update auf 4.2.6. durchgeführt.
> >>> Hat aber nichts gebracht.
> >>> Der Fehler besteht weiterhin.
> >>>
> >>>  > Dann heisst Du vielleicht ein SQL-Problem in dieser Extension.
> >>> Schau dir
> >>>  > mal die Statements an.
> >>>
> >>> Klar, aber diese Warnungen tauchen bei mehreren Extensions auf die
> >>> alle woanders problemlos laufen.
> >>>
> >>> Kann man irgendwie nachforschen wodurch die Warnungen ausgelöst werden?
> >>>
> >>> LG Thomas
> >>>
> >>>
> >> mySQL-Server im Debugmode?
> >>> Rainer Schleevoigt schrieb:
> >>>
> >>>> Peter Russ schrieb:
> >>>>
> >>>>> --- Original Nachricht ---
> >>>>> Absender:   Thomas Hirt
> >>>>> Datum:       10.02.2009 18:42:
> >>>>>
> >>>>>
> >>>>>> Hi!
> >>>>>> In einer meiner Installation tauchen unten stehende Warnungen im
> >>>>>> Backend (Typo3 4.2.0) auf.
> >>>>>>
> >>>>>> Sobald ich im Extension Manager auf eine bestimmte Extension
> >>>>>> klicke um zu den Informationen zu gelangen sehe ich folgende Zeilen:
> >>>>>>
> >>>>>> Warning: mysql_fetch_assoc(): supplied argument is not a valid
> >>>>>> MySQL result resource in
> >>>>>> /home/.sites/206/site726/web/cms/t3lib/class.t3lib_db.php on line
> >>>>>> 1009
> >>>>>>
> >>>>>> Warning: mysql_fetch_assoc(): supplied argument is not a valid
> >>>>>> MySQL result resource in
> >>>>>> /home/.sites/206/site726/web/cms/t3lib/class.t3lib_db.php on line
> >>>>>> 1027
> >>>>>>
> >>>>>> Warning: mysql_fetch_assoc(): supplied argument is not a valid
> >>>>>> MySQL result resource in
> >>>>>> /home/.sites/206/site726/web/cms/t3lib/class.t3lib_db.php on line
> >>>>>> 1009
> >>>>>>
> >>>>>> Warning: mysql_fetch_assoc(): supplied argument is not a valid
> >>>>>> MySQL result resource in
> >>>>>> /home/.sites/206/site726/web/cms/t3lib/class.t3lib_db.php on line
> >>>>>> 1027
> >>>>>>
> >>>>>> Warning: mysql_fetch_assoc(): supplied argument is not a valid
> >>>>>> MySQL result resource in
> >>>>>> /home/.sites/206/site726/web/cms/t3lib/class.t3lib_db.php on line
> >>>>>> 1009
> >>>>>>
> >>>>>> Warning: mysql_fetch_assoc(): supplied argument is not a valid
> >>>>>> MySQL result resource in
> >>>>>> /home/.sites/206/site726/web/cms/t3lib/class.t3lib_db.php on line
> >>>>>> 1027
> >>>>>>
> >>>>>> Dieses Problem tritt aber nicht bei allen Extensions auf:
> >>>>>>
> >>>>>> SmoothGallery for TYPO3 --> JA
> >>>>>> Photo Book --> JA
> >>>>>> News --> JA
> >>>>>> mm_forum --> JA
> >>>>>> Flash Video Player v2 -- NEIN
> >>>>>>
> >>>>>> Seltsam.
> >>>>>> Und ja, ich habe nach dem Update ein compare durchgeführt ;)
> >>>>>>
> >>>>>> Hat jemand eine Idee was ich machen könnte?
> >>>>>>
> >>>>>> Thomas
> >>>>>>
> >>>>> Ich würde dir erstmal update auf 4.2.6 empfehlen. Sonst taucht bald
> >>>>> nix mehr auf ;-)
> >>>>>
> >>>>> Gruss. Peter.
> >>>>>
> >>>>>
> >>>> Dann heisst Du vielleicht ein SQL-Problem in dieser Extension. Schau
> >>>> dir mal die Statements an.
> >>>>
> >>>> Rainer
> >>>>
> >>> _______________________________________________
> >>> TYPO3-german mailing list
> >>> TYPO3-german at lists.netfielders.de
> >>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-german
> >>
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-german


More information about the TYPO3-german mailing list