simulace MySQL na Postgresu

Petr Bravenec pbravenec na solartec.cz
Úterý Srpen 2 07:47:51 CEST 2005


Cut&paste z kusu kódu, který, odhaduju, dělá přibližně to, co chcete:

############################################################################
Function ZobrazDotaz ($nadpis, $query, $hlavicky=null) {
global $DB;
$ri = Pg_exec ($DB, $query);
if (!$ri || pg_numrows($ri)<=0)
return;
print $nadpis."<br>";
$array = pg_fetch_array ($ri, 0);
print "<table class=\"data-m\">";
print "<thead><tr>\n";
Reset($array);
if (! is_array($hlavicky)) {
while (List ($klic, $hodnota) = each($array)) {
if (is_integer($klic)) continue;
print "<th>".$klic."</th>\n";
}
} else {
while (is_array($hlavicky) && List ($klic, $hodnota) = each($hlavicky)) {
print "<th>".$hodnota."</th>\n";
}
}

Petr Bravenec
-- 


email: pbravenec na solartec.cz
telefon: +420 777 566 384
icq: 227051816
www: http://www.solartec.cz/
Klíè pro ¹ifrování po¹ty: http://server.solartec.cz/Petr.Bravenec.gpg.asc




Další informace o konferenci Linux