error message Unexpected character in input: '\' (ASCII=92)
Posted: Wed Jun 29, 2005 7:06 pm
im trying to generate a xml document from a mysql database using php
ive used this code before without any problems.
the only difference is that im trying to add data from a second database table as "<comments>"
however, for some reason im getting an error about character input when i try to do this.
here is my exact error message:
line 55 is commented.
any assistance would be appreicated
ive used this code before without any problems.
the only difference is that im trying to add data from a second database table as "<comments>"
however, for some reason im getting an error about character input when i try to do this.
here is my exact error message:
here is my code.Warning: Unexpected character in input: '\' (ASCII=92) state=1 in e:\wamp\www\simonweb\trainblogpost.php on line 55
Parse error: syntax error, unexpected T_STRING in e:\wamp\www\simonweb\trainblogpost.php on line 55
line 55 is commented.
Code: Select all
$con = mysql_connect("e;localhost"e;);
mysql_select_db("e;simonweb"e;);
$qpost = mysql_query("e;SELECT id, date, time, idea FROM trainblog1 ORDER BY id DESC"e;);
$xml = "e;<?xml version=\"e;1.0\"e; encoding=\"e;UTF-8\"e;?>\n<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by simon (simon) -->\n<trainblog>\n"e;;
$numrows1 = mysql_num_rows($qpost);
if (!($fp = fopen("e;trainblog.xml"e;,"e;w"e;)));
for ($i=0; $i<$numrows1; $i++){
$row1 = mysql_fetch_array($qpost);
$xml .= "e;\t<entry id=\"e;$row1ї0]\"e;>\n\t\t<date>$row1ї1]</date>\n\t\t<time>$row1ї2]</time>\n\t\t<idea>$row1ї3]</idea>\n\t\t<comments>\n"e;;
$qcomment = mysql_query("e;SELECT author, date, time, said FROM trainblog2 WHERE `id` =$row1ї0]);
$numrows2 = mysql_num_rows($qcomment);
for ($j=0; $j<$numrows2; $j++){
$row2 = mysql_fetch_array($qcomment);
$xml .= "e;\t\t\t<comment>\n"e;; //////////////////////THIS IS LINE 55!
$xml .= "e;\t\t\t\t<author>$row2ї0]</author>\n"e;;
$xml .= "e;\t\t\t\t<date>$row2ї1]</date>\n"e;;
$xml .= "e;\t\t\t\t<time>$row2ї2]</time>\n"e;;
$xml .= "e;\t\t\t\t<said>$row2ї3]</said>\n"e;;
$xml .= "e;\t\t\t</comment>\n"e;;
}
$xml .= "e;\t\t</comments>\n\t</entry>"e;;
}
$xml .= "e;</trainblog>"e;;
fwrite($fp, $xml);
fclose($fp);
mysql_close($con);
?>