@: Static data structure?? What do you mean? Hardcoded HTML? I tried the microtime() function with the same results, although now with greater precision.
The instruction "$line = mysql_fetch_array($result, MYSQL_ASSOC)" takes 0.0001 seconds.
Here the results for the rest:
TR_start took 0 sec. and 1.7000000000003E-005 ms.
TD_DATE took 0 sec. and 0.016705 ms.
TD_TIME took 0 sec. and 0.016583 ms.
TD_KANAL took 0 sec. and 0.016496 ms.
TD_BETRIEBSART took 0 sec. and 0.016571 ms.
TD_AN took 0 sec. and 0.016566 ms.
TD_VON took 0 sec. and 0.016498 ms.
TD_EREIGN took 0 sec. and 0.016567 ms.
TD_VERMERK took 0 sec. and 0.016562 ms.
TR took 0 sec. and 1.2999999999985E-005 ms.
TD_DATE took 0 sec. and 0.016528 ms.
TD_TIME took 0 sec. and 0.041425 ms.
TD_KANAL took 0 sec. and 0.016521 ms.
TD_BETRIEBSART took 0 sec. and 0.016561 ms.
TD_AN took 0 sec. and 0.016565 ms.
TD_VON took 0 sec. and 0.016567 ms.
TD_EREIGN took 0 sec. and 0.016575 ms.
TD_VERMERK took 0 sec. and 0.016551 ms.
TR took 0 sec. and 1.2000000000012E-005 ms.
..
SNIP
..
took 3 sec. and 0.712862 ms.
@: As I already mentioned the query IS NOT the issue. It completes in a few ms both in PHP, mysql.exe and MySQL Control Center. It's a PHP issue.
$query = "SELECT *, DATE_FORMAT(Zeitstempel, '%H:%i:%s') AS Zeit, DATE_FORMAT(Zeitstempel, '%d.%m.') AS Datum
FROM betriebsbuch_zeile, einsatz
WHERE einsatz.ID = '" . $EinsatzID ."'
ORDER BY Zeitstempel DESC;";
The table (how I get it back from MySQLCC):
CREATE TABLE betriebsbuch_zeile (
ID int(10) unsigned NOT NULL auto_increment,
EinsatzID int(10) unsigned NOT NULL default '0',
Zeitstempel datetime NOT NULL default '0000-00-00 00:00:00',
Kanal smallint(6) NOT NULL default '0',
Betriebsart set('GU','WU','GO','WO') NOT NULL default '',
An varchar(40) NOT NULL default '',
Von varchar(40) NOT NULL default '',
Ereignis varchar(200) NOT NULL default '',
Vermerk varchar(100) default NULL,
PRIMARY KEY (ID),
KEY EinsatzID (EinsatzID),
CONSTRAINT 0_133 FOREIGN KEY (EinsatzID) REFERENCES einsatz (ID)
) TYPE=InnoDB;