zainstalowałem sobie ostatnio apacha 2.0.58, mysqla 5.0.22 i php 5.1.4. Wszystko działa, lecz php nie wykonuje zapytań mysql'a np. mysql_connect. Mogłem coś źle skonfigurować jeśli tak to powiedzcie co, albo może to być błąd w skrypcie
<?php
header('Content-Type: text/html; charset = iso-8859-2'); if (!$dbconnect = mysql_connect('localhost', 'root', 'nie podam')) { echo "Nie można się połączyć z 'localhost'."; } // if
echo "Nie można się połączyć z bazą 'news_xml'"; } // if
$table_id = 'item';
// Utworz nowy dokument DOM
$dom = new DOMDocument('1.0', 'iso-8859-2');
// create the root element
$rss = $dom->createElement('rss');
$dom->appendChild($rss);
$newattr = $dom->createAttribute('version');
$rss->appendChild($newattr);a
$sattr = $rss->setAttribute('version', '2.0');
$rss->appendChild($sattr);
// create the channel element
$channel = $dom->createElement('channel');
$rss->appendChild($channel);
// now create all the subelements for the channel
$title = $channel->appendChild($dom->createElement('title'));
$title->appendChild($dom->createTextNode('4asy'));
$link = $channel->appendChild($dom->createElement('link'));
$link->appendChild($dom->createTextNode('http://www.czteryasy.pl'));
$description = $channel->appendChild($dom->createElement('description'));
$description->appendChild($dom->createTextNode('Wydarzenia w naszej firmie'));
$language = $channel->appendChild($dom->createElement('language'));
$language->appendChild($dom->createTextNode('pl'));
$webMaster = $channel->appendChild($dom->createElement('webMaster'));
$webMaster->appendChild($dom->createTextNode('Dzobert@interia.pl'));
// create the image element
$image = $channel->appendChild($dom->createElement('image'));
$image->appendChild($dom->createTextNode(''));
// now create all the subelements for the image
$title = $image->appendChild($dom->createElement('title'));
$title->appendChild($dom->createTextNode('4asy'));
$link = $image->appendChild($dom->createElement('link'));
$link->appendChild($dom->createTextNode('http://www.czteryasy.pl/'));
$url = $image->appendChild($dom->createElement('url'));
$url->appendChild($dom->createTextNode('http://www.czteryasy.pl/style/img/nav.gif'));
$height = $image->appendChild($dom->createElement('height'));
$height->appendChild($dom->createTextNode('80'));
$width = $image->appendChild($dom->createElement('width'));
$width->appendChild($dom->createTextNode('80'));
// za�aduj wiersz z bazy
// utwórz element/wezel dla kazdego rekordu
$occ = $dom->createElement($table_id);
$channel->appendChild($occ);
// Dodaj węzeł potomny dla każďego z elementďów
foreach ($row as $fieldname => $fieldvalue) {($occ);
$child = $dom->createElement($fieldname);
$occ->appendChild($child);
$value = $dom->createTextNode($fieldvalue);
$child->appendChild($value);
} // foreach
} // while
// pobierz gotowy dokument XML
$xml_result = $dom->saveXML();
print $dom->save("rss.xml");
<textarea cols='150' rows='40' name='xml_result'>$xml_result</textarea>
XML_SHOW;
?>
Może to być błąd w pliku php.ini?