Web Analytics Made Easy -
StatCounter simplexml_load_file error - CodingForum

Announcement

Collapse
No announcement yet.

simplexml_load_file error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • simplexml_load_file error

    quick question that refers to running an xml file to update my database and one of the variables containing an apostrophe.

    Error:
    Code:
    Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /home/xxxxxx/public_html/xxxx/blurb.php on line 22
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Fragrance', 'Rochas', 'http://www.thewebsite.com/detail.cfm?ref=AW&code=3' at line 26
    cannot figure this out. Have tried my_real_escape_string but that's once the xml file has parsed and the variables are defined.

    Another error:

    Code:
    Warning: simplexml_load_file() [function.simplexml-load-file]: http://datafeeds.productserve.com/datafeed_products.php?user=xxxxx&password=xxxxxxxx&mid=1184&format=xml&dtd=1.2:3574: parser error : Entity 'Atilde' not defined in /home/xxxxxx/public_html/cols/blurb.php on line 22
    Here's my code:

    Code:
    $xml = simplexml_load_file('http://datafeeds.productserve.com/datafeed_products.php?user=xxxxx&password=xxxxxxxx&mid=1184&format=xml&dtd=1.2');
    
    foreach ($xml->xpath('//prod') as $character) {
    
      $awId = $character["awId"];
      $awCatId = $character->cat->awCatId;
      $awCat = $character->cat->awCat;
      $mCat = $character->cat->mCat;
      $search = $character->price->search;
      $rrp = $character->price->rrp;
    
    } ...etc.
    Any ideas guys? Seem to be asking for so much help lately, but this kind of syntax stuff really does stump me!

  • #2
    Which one is your line 22?

    Comment


    • #3
      Line 22:
      Code:
      $xml = simplexml_load_file('http://datafeeds.productserve.com/datafeed_products.php?user=xxxx&password=xxxxxxxx&mid=1184&format=xml&dtd=1.2');

      Comment

      Working...
      X