again thanks for the relpy..
i have tried tracing everything... from the MY_PIC.length to every MY_PIC even to every variable in the script...
the trace in every loop is just an empty line.. the first 3 are the paths that i have set in the xml and then it just takes it down a line...
And then it starts outputing the url errors..
Which come to think of it gives me an idea.. what if it reads them as pagebreaks or enter? how could i check for pagebreaks or enter? != what?
as for the php i'm working on a "if loop" to check the value before puting them in the xml...
but here is the original version just for your reference..
PHP Code:
<?php
header("Content-type: text/xml");
include 'dat.php';
// Connect to server and select databse.
$linkID = mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db($db_name, $linkID)or die("cannot select DB");
$query = "SELECT * FROM $tbl_name";
$resultID = mysql_query($query, $linkID) or die("Data not found.");
$xml_output = "<?xml version=\"1.0\" encoding=\"utf8\"?>\n";
$xml_output .= "<ABOUT>\n";
for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
$row = mysql_fetch_assoc($resultID);
$xml_output .= "\t<ISLAND>\n";
$xml_output .= "\t\t<ISLAND_NAME>" . $row['ISLAND_NAME'] . "</ISLAND_NAME>\n";
$xml_output .= "\t\t<ISLAND_DESCR>" . $row['ISLAND_DESCR'] . "</ISLAND_DESCR>\n";
$xml_output .= "\t\t<ACTIVITIES>" . $row['ACTIVITIES'] . "</ACTIVITIES>\n";
$xml_output .= "\t\t<EXCURSIONS>" . $row['EXCURSIONS'] . "</EXCURSIONS>\n";
$xml_output .= "\t\t<ISLAND_PHOTOS>\n";
$xml_output .= "\t\t\t<ISLAND_PHOTO_1>" . $row['ISLAND_PHOTO_1'] . "</ISLAND_PHOTO_1>\n";
$xml_output .= "\t\t\t<ISLAND_PHOTO_2>" . $row['ISLAND_PHOTO_2'] . "</ISLAND_PHOTO_2>\n";
$xml_output .= "\t\t\t<ISLAND_PHOTO_3>" . $row['ISLAND_PHOTO_3'] . "</ISLAND_PHOTO_3>\n";
$xml_output .= "\t\t\t<ISLAND_PHOTO_4>" . $row['ISLAND_PHOTO_4'] . "</ISLAND_PHOTO_4>\n";
$xml_output .= "\t\t\t<ISLAND_PHOTO_5>" . $row['ISLAND_PHOTO_5'] . "</ISLAND_PHOTO_5>\n";
$xml_output .= "\t\t\t<ISLAND_PHOTO_6>" . $row['ISLAND_PHOTO_6'] . "</ISLAND_PHOTO_6>\n";
$xml_output .= "\t\t\t<ISLAND_PHOTO_7>" . $row['ISLAND_PHOTO_7'] . "</ISLAND_PHOTO_7>\n";
$xml_output .= "\t\t\t<ISLAND_PHOTO_8>" . $row['ISLAND_PHOTO_8'] . "</ISLAND_PHOTO_8>\n";
$xml_output .= "\t\t\t<ISLAND_PHOTO_9>" . $row['ISLAND_PHOTO_9'] . "</ISLAND_PHOTO_9>\n";
$xml_output .= "\t\t\t<ISLAND_PHOTO_10>" . $row['ISLAND_PHOTO_10'] . "</ISLAND_PHOTO_10>\n";
$xml_output .= "\t</ISLAND_PHOTOS>\n";
$xml_output .= "\t</ISLAND>\n";
}
$xml_output .= "</ABOUT>";
$filenamepath = "about.xml";
$fp = fopen($filenamepath,'w');
fwrite($fp,$xml_output);
fclose($filenamepath);
echo $xml_output;
?>
I'll post the new php when i manage to finish it..