Jump to content

the_opposite

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

the_opposite's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you Roman, I wasn't aware of that htmlentities function
  2. Hi all, I am at a loss to understand why this doesn't work. I have a simple function: function toHTML($inputText) { $inputText = str_replace('<','<',$inputText); $inputText = str_replace('>','>',$inputText); $inputText = str_replace('&','&',$inputText); $inputText = str_replace("'",''',$inputText); $inputText = str_replace('"','"',$inputText); return $inputText; } When I run code through it, specifically xml files from which I need to remove/replace the above charachters, it seems to refuse to replace all of the characters. For example, when I run the following text through this function, the '&' charachter I have highlighted is not replaced: <?xml version="1.0" ?> <!-- Purchase Order XML Copyright 2010 Version 1.0 --><PurchaseOrder> <Envelope> <SenderID>xxx</SenderID> <ReceiverID>xxx</ReceiverID> <DateStamp type="MessageDate">2011-02-09</DateStamp> <VersionID>1.4</VersionID> </Envelope> <Header> <Party type="SoldTo"> <IDNumber type="Supplier">xxx</IDNumber> <IDNumber type="Reseller">xxx</IDNumber> <Name>John Doe</Name> <AddressLine1>Temp</AddressLine1> <AddressLine2>Address 1</AddressLine2> <AddressLine3>Address 1</AddressLine3> <Street>Address 1</Street> <City>West Midlands</City> <PostCode>DY9 8QH</PostCode> <CountryCode>GB</CountryCode> <ContactPhone>01384444555</ContactPhone> </Party> <Party type="ShipTo"> <IDNumber type="Supplier">xxx</IDNumber> <IDNumber type="Reseller">DIRECTDROP</IDNumber> <Name> </Name><AddressLine1></AddressLine1> <Street></Street> <City></City><PostCode></PostCode> <CountryCode></CountryCode> <ContactPhone></ContactPhone> </Party> <!-- Kill/Fill 1-Back order allow. 2-Back order allow but ship complete. 3-Line item kill or fill. 4-whole order kill or fill. --> <KillOrFill>1</KillOrFill> <TotalValues> <Currency>GBP</Currency> <VATRate>20.0</VATRate> <MonetaryAmount type="FreightCharge">5.00</MonetaryAmount> <MonetaryAmount type="VATAmount">1</MonetaryAmount> <MonetaryAmount type="GoodsNetTotal">0</MonetaryAmount> <MonetaryAmount type="OrderNetTotal">5</MonetaryAmount> <MonetaryAmount type="GrossTotal">6</MonetaryAmount> </TotalValues> <OrderType>Direct Drop</OrderType> <DocumentReference> <DocumentNumber type="ResellerPO">J653</DocumentNumber> <DateStamp type="ResellerPO">2011-02-09</DateStamp> </DocumentReference> </Header> <Line> <Item> [b][color=red]<ProductName>Freecom Hard Drive Dock 2.5/3.5 USB&SATA</ProductName>[/color][/b] <ProductNumber type="Supplier">3294</ProductNumber> <Quantity type="Ordered">2</Quantity> <MonetaryAmount type="UnitPrice"></MonetaryAmount> <MonetaryAmount type="LineTotal">0</MonetaryAmount> </Item> </Line> </PurchaseOrder> The '&' between USB&SATA is not replaced with & on this line: <ProductName>Freecom Hard Drive Dock 2.5/3.5 USB&SATA</ProductName> Does anybody know why? Thanks in advance
  3. Thanks Keith - That did the trick. Can't believe I didn't spot that
  4. I've got this annoying issue that I hope somebody could help with. QUERY: SELECT DISTINCT archive_order_lines.status, archive_order_lines.quantity, arch_orders.payment_status, arch_orders.order_number FROM arch_orders as orders, archive_order_lines as order_lines WHERE arch_orders.order_number=archive_order_lines.order_number AND archive_order_lines.prod_code LIKE '%%' AND (arch_orders.payment_datetime LIKE '%Jan 20 2010%') ORDER BY arch_orders.order_number ASC This produces the following error: can't find order numbers Unknown column 'archive_order_lines.status' in 'field list' All of the above fields are definitely present in the tables. The error reported always shows the first part of the query i.e. if i changed the first part of the query to: SELECT DISTINCT archive_order_lines.quantity, archive_order_lines.status, ... the resulting error would say: can't find order numbers Unknown column 'archive_order_lines.quantity' in 'field list' This query works correctly with other DB tables. Any ideas why this does not work? (sorry, I'm not sure what version of MySQL is installed on the server)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.