---
title: "\"headers already sent\" plötzlich und unerwartet"
url: "https://www.typo3.net/d/64016-headers-already-sent-ploetzlich-und-unerwartet"
source: "typo3.net"
tags: ["Extensions","Datenbank","Frage"]
created: "2007-06-16"
last_reply: "2007-06-16"
replies: 7
solved: false
page: 1
pages: 1
lang: "de"
---

# "headers already sent" plötzlich und unerwartet

Extensions · 7 Antworten · gestartet 2007-06-16

## Eröffnungsbeitrag

**cope** · 2007-06-16 · [Beitrag #1](https://www.typo3.net/d/64016-headers-already-sent-ploetzlich-und-unerwartet/1)

Hallo lieber Typo3'ler,

kennt vielleicht jemand folgendes Problem?
Ich habe seit ca. einer Woche an einer Seite nicht gearbeitet, deren Shop einwandfrei funktionierte. Heute wollte ich die Seite vorführen und erhalte bei der Kategorieansicht einen SQL-Fehler?

Dazu habe ich das SQL-Debug eingeschaltet und bekomme die weiter unten aufgeführten Meldungen.
Ich schätze mal, es fehlt ein Semikolon am Ende der generierten SQL-select-Anweisung? Neuinstallation und "compare" halfen auch nicht weiter...

Dies ist das zugehörige TypoScript

```typoscript
tempCategory = CONTENT
tempCategory {
	table = tt_products_cat
	wrap =<ul>|</ul>
	select {
		pidInList=24
		where = deleted=0
		andWhere = hidden=0
	}
	renderObj = COA
	renderObj {		
		wrap = <li>|</li>
		10 = TEXT
		10.field = title
		10.wrap = |
		10.typolink {
			#parameter.data=TSFE:id
			parameter=35
			additionalParams.insertData = 1
			additionalParams=&tx_ttproducts_pi1[cat]={field:uid}
		} 
	}		
}
```

Ich verwende Typo3 4.0.4
realurl 1.14
tt_products 2.5.2

MySQL - 4.1.22-standard
(Dieser MySQL-Server läuft bereits 44 Tage, 5 Stunden, 4 Minuten und 17 Sekunden. Er wurde am 02. Mai 2007 um 20:00 gestartet.)....

Völlig hilflos  #angry#
LG
Cope

P.S. entschuldigt bitte den vielen Text

---- mit sql debug ---------------------------------------
caller	t3lib_DB::exec_SELECTquery
ERROR	You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5
lastBuiltQuery	SELECT tt_products_cat.uid uid,tt_products_cat.pid pid,tt_products_cat.tstamp tstamp,tt_products_cat.crdate crdate,tt_products_cat.deleted deleted,tt_products_cat.sorting sorting,tt_products_cat.title title,tt_products_cat.subtitle subtitle,tt_products_cat.image image,tt_products_cat.email_uid email_uid,tt_products_cat.parent_category parent_category
FROM tt_products_cat tt_products_cat
WHERE
1=1 AND tt_products_cat.deleted=0 AND tt_products_cat.uid=5
ORDER BY .title
debug_backtrace	require // include // TSpagegen::renderContent // tslib_cObj->cObjGet // tslib_cObj->cObjGetSingle // tslib_cObj->cObjGetSingle // tslib_cObj->TEMPLATE // tslib_cObj->cObjGetSingle // tslib_cObj->USER // tslib_cObj->callUserFunction // call_user_method // tx_ttproducts_pi1->main // tx_ttproducts_pi1->doProcessing // tx_ttproducts_pi1->products_display // tx_ttproducts_list_view->printView // tx_ttproducts_category->getMarkerArray // tx_ttproducts_category->get // tx_table_db->exec_SELECTquery // t3lib_DB->exec_SELECTquery // t3lib_DB->debug

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/www/web298/html/hafacms/t3lib/class.t3lib_db.php on line 802

Warning: Cannot modify header information - headers already sent by (output started at /home/www/web298/html/hafacms/t3lib/class.t3lib_db.php:1096) in /home/www/web298/html/hafacms/typo3/sysext/cms/tslib/class.tslib_fe.php on line 2853
-------------------------------------------------------

## Antworten

### [#2](https://www.typo3.net/d/64016-headers-already-sent-ploetzlich-und-unerwartet/2) · just2b · 2007-06-16

wohl eher das

> ORDER BY **.**title

also mal im ts bzw in der ext nach dem suchen..

georg

### [#3](https://www.typo3.net/d/64016-headers-already-sent-ploetzlich-und-unerwartet/3) · cope · 2007-06-16

Wow,

wie schnell geht das denn hier? Hallo Georg,
die Seiten, auf denen dieser Effekt auftritt hat als Ext.Template nur

```typoscript
BodyTempl.subparts.mitte-content < plugin.tt_products
```

Sieht also für mich Laien so aus, dass beim Rendern (sagt man doch so?) der
Listenansicht neuerdings was schief läuft.

Stimmt

> ORDER BY .title

da fehlt scheinbar der Spalten/Alias Name?
Ich grab mich dann mal durch den tt_product-Dschungel.

Achso...

> tx_ttproducts_list_view->printView

finde ich auch merkwürdig. Klingt nach Druckansicht, die ich nicht verwende....

***heul***
Naja, ist erst 1:23, noch jung der Tag

Viele Grüße
Cope

### [#4](https://www.typo3.net/d/64016-headers-already-sent-ploetzlich-und-unerwartet/4) · just2b · 2007-06-16

naja auch andere arbeiten noch ;))

du kannst dir natürlich das plugin.tt_products anschauen, wenns nur bei dem dann auftritt

lg georg

### [#5](https://www.typo3.net/d/64016-headers-already-sent-ploetzlich-und-unerwartet/5) · cope · 2007-06-16

Hallo Georg,

ich glaub, ich arbeite gar nicht mehr wirklich; eher so Zombie-mäßiges gehabe :D

Ok, hab mal in tt_products rumgesucht. Folgendes ist dabei herausgekommen:

in .../tt_products/model/class.tx_ttproducts_category.php gibt es eine Methode "get". Darin wird ein

```php
$res = $this->table->exec_SELECTquery('*',$where,'',$TYPO3_DB->stripOrderBy($orderBy));
```

ausgeführt. (Zeile 110)

Das

```php
$TYPO3_DB->stripOrderBy($orderBy))
```

enthält mit print_r ausgegeben nur "title" (also nicht ".title"). Ich mache per "echo" eine Testausgabe "HUHU<br/>".
Dann kommt die "exec_SELECTquery" und danach nocheinmal eine Testausgabe "HALLO<br/>".

Ergebnis:

---------------------------------------------------------------
titleHUHU
caller	t3lib_DB::exec_SELECTquery
ERROR	You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5
lastBuiltQuery	SELECT tt_products_cat.uid uid,tt_products_cat.pid pid,tt_products_cat.tstamp tstamp,tt_products_cat.crdate crdate,tt_products_cat.deleted deleted,tt_products_cat.sorting sorting,tt_products_cat.title title,tt_products_cat.subtitle subtitle,tt_products_cat.image image,tt_products_cat.email_uid email_uid,tt_products_cat.parent_category parent_category
FROM tt_products_cat tt_products_cat
WHERE
1=1 AND tt_products_cat.deleted=0 AND tt_products_cat.uid=6
ORDER BY .title
debug_backtrace	require // include // TSpagegen::renderContent // tslib_cObj->cObjGet // tslib_cObj->cObjGetSingle // tslib_cObj->cObjGetSingle // tslib_cObj->TEMPLATE // tslib_cObj->cObjGetSingle // tslib_cObj->USER // tslib_cObj->callUserFunction // call_user_method // tx_ttproducts_pi1->main // tx_ttproducts_pi1->doProcessing // tx_ttproducts_pi1->products_display // tx_ttproducts_list_view->printView // tx_ttproducts_category->getMarkerArray // tx_ttproducts_category->get // tx_table_db->exec_SELECTquery // t3lib_DB->exec_SELECTquery // t3lib_DB->debug
HALLO
---------------------------------------

popelt das execSelectquery da irgendwo einen Punkt '.' rein???

Yes well! In "typo3conf/ext/table/lib/class.tx_table_db.php!
So ca. bei Zeile 627

```php
		echo $orderBy."<br/>"; <--- hier kommt "title"
		$orderBy = $this->transformOrderby ($orderBy);
		echo $orderBy."<br/>";<--- hier kommt ".title"!!!
```

Mal Zombiekaffee machen.....und dann transformOrderby sezieren

LG
Cope

### [#6](https://www.typo3.net/d/64016-headers-already-sent-ploetzlich-und-unerwartet/6) · cope · 2007-06-16

Zombiekaffee hilft...

klappt wieder der Krempel!

Der Fehler(?) liegt in der im letzten "Post" genannten class.tx_table_db.php.
In Zeile 464 wird

```php
$fieldTmp = $this->aliasArray[$tableName].'.'.$field;
```

ausgeführt. In meinem Falle ist

```php
$this->aliasArray[$tableName]
```

leer !!!

ersetzt man in dieser Datei die Zeile 464 durch die Zeilen

```php
if ($this->aliasArray[$tableName])
  $fieldTmp = $this->aliasArray[$tableName].'.'.$field;	
else
  $fieldTmp = $field;
```

gehts wieder.

Danke Georg für den Hinweis auf

> order by .title

LG
Cope

### [#7](https://www.typo3.net/d/64016-headers-already-sent-ploetzlich-und-unerwartet/7) · Flink · 2007-06-16

Ein ausgefülltes $this->aliasArray ist Voraussetzung für das Funktionieren der Table Library.
Der Aufruf von setTCAFieldArray erfolgt in der init Funktion von model/class.tx_ttproducts_category.php.

Es müßte also in tt_products korrigiert werden, falls es nicht funktionieren sollte.
Hier eine Test-Version:

<http://jambage.com/development/tt_products-2.5.2-3.tar.gz>

### [#8](https://www.typo3.net/d/64016-headers-already-sent-ploetzlich-und-unerwartet/8) · cope · 2007-06-16

Hallo Flink

vielen vielen Dank für die schnelle Antwort und eine "saubere Lösung".

Habt mir sehr geholfen

LG
Cope

---

Quelle: „"headers already sent" plötzlich und unerwartet“, typo3.net, https://www.typo3.net/d/64016-headers-already-sent-ploetzlich-und-unerwartet
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
