
 Fernando Reis Guimaraes - 2007-08-23 18:31:52
 
Hello guys!
I hope that I have found a bug in this class!
When I have tryed to send a REPLACE or INSERT statement, then I got error on line 91.
That line tries to fetch results when does not have nothing to fetch because that isnīt a SELECT statement.
I have fixed that, simply put that before line 91, do not forget to close 
if (is_resource($result)) // THAT IS BUG FIX
{
	// process one row at a time
	while ($row = mysql_fetch_assoc($result)) {
	// Keep the row count
	$rowCount = $rowCount + 1;
	// Add node for each row
	$element = $doc->createElement('row');
	$element = $root->appendChild($element);
	$element->setAttribute('index', $rowCount);
	// Add a child node for each field
	foreach ($row as $fieldname => $fieldvalue) {
		$child = $doc->createElement($fieldname);
		$child = $element->appendChild($child);
		// $fieldvalue = iconv("ISO-8859-1", "UTF-8", $fieldvalue);
		$fieldvalue = htmlspecialchars($fieldvalue);
		$value = $doc->createTextNode($fieldvalue);
		$value = $child->appendChild($value);
		} // foreach
	
	} // while
} // THAT BUG FIX ENDS HERE!
Contribution of Fernando Reis Guimarães
Site http://www.fernandobhz.com.br