SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    xml parser makes my query acts weird

    i have a very strange error and am un able to analyzze it.
    iam using the to post offers into my database from other sites using their online xml sheets.

    am using the normal xml_parse() library we all use.
    after i fetch each offer from the sheet i make an entry for this offer in my database.

    the query is inside the endElement() function
    all the queries are working like charm but not on the price field of my database.
    all the fields are filled correctly while the price is the same for all the offers.
    here's the code
    PHP Code:
     function endElement($parser$tagName) {
               
    //Time to close the tags
            
           
    if ($tagName == "ITEM") {
                
                
    mysql_query("UPDATE items_re,items,posts set   City='".trim($this->city)."', items.BuyItNowPrice= '".$this->price."' , items.Description='".trim($this->description)."' where Customer_Ref=".$this->ref."  "); 
    if i fetched lets say 20 offers, i found that the first 10 offers has the same price of the first and the 2nd 10 offers has the same price of the 11th offer ....
    the strange thing is, that i printed the query and guess what
    the price number is right :S.

    If the query is right then why its not running right ??
    lebanon real estate www.REmonitor.com beirut apartment for sale

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think that due to the speed of the xml_parse()
    the update query is unable to write the price field.
    why the price field only ???
    the only difference i can see between this field and the other is that this field has a dataype of double...
    this is the only field with double data type !!! could this be the reason
    should i give the query more time to run like a sleep() after maybe..
    lebanon real estate www.REmonitor.com beirut apartment for sale


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •