Jump to content

tobeyt23

Members
  • Posts

    259
  • Joined

  • Last visited

Everything posted by tobeyt23

  1. How do you find values in the same table that are a like?
  2. I have a table with addresses in them and need to find the duplicates. Some address will be like 1000 somewhere st or 1000 somewhere Street or 100 main street ste 100 or 100 main st Suite 100. How can i match them up? table would be like this: id address city state zip Thanks
  3. Any help would be greatful, I am banging my head here!
  4. Still not working, what am I missing? $_xml_string = '<Order> <EmbeddedDoc DocumentName="TestDoc" DocumentFormat="PDF">jdsahfdhflhfsdlfhdslhsdflsdfhflkdslkfsdhkfhskldhkl</EmbeddedDoc> <EmbeddedDoc DocumentName="TestDoc1" DocumentFormat="PDF">jdsahfdhflhfsdlfhdslhsdflsdfhflkdslkfsdhkfhskldhkl</EmbeddedDoc> </Order>'; $xml = new SimpleXMLElement($_xml_string); foreach ($xml->xpath('//EmbeddedDoc') as $doc) { $doc = '##FILE##'; } $newxml = $xml->asXML(); echo $newxml;
  5. $_xml_string = '<Order> <EmbeddedDoc DocumentName="TestDoc" DocumentFormat="PDF">jdsahfdhflhfsdlfhdslhsdflsdfhflkdslkfsdhkfhskldhkl</EmbeddedDoc> <EmbeddedDoc DocumentName="TestDoc1" DocumentFormat="PDF">jdsahfdhflhfsdlfhdslhsdflsdfhflkdslkfsdhkfhskldhkl</EmbeddedDoc> </Order>'; $xml = simplexml_load_string($_xml_string); foreach ($xml->xpath('//EmbeddedDoc') as $doc) { $doc = '##FILE##'; } print_r($xml);
  6. Any suggestions still cant seem to get the value to change?
  7. The xml EmbeddedDoc contains base64 encoded document so I want to string that out before i save the string to DB.
  8. Yes, sorry I did do that $_xml_string = simplexml_load_string($_xml_request_data,'SimpleXMLElement', LIBXML_PARSEHUGE); However still cant replace the value.
  9. Need to change the value in an XML string tried the following but no luck, any suggestions? $_xml_string = '<Order> <EmbeddedDoc DocumentName="TestDoc" DocumentFormat="PDF">jdsahfdhflhfsdlfhdslhsdflsdfhflkdslkfsdhkfhskldhkl</EmbeddedDoc> <EmbeddedDoc DocumentName="TestDoc1" DocumentFormat="PDF">jdsahfdhflhfsdlfhdslhsdflsdfhflkdslkfsdhkfhskldhkl</EmbeddedDoc> </Order>'; foreach($_xml_string->Order->EmbeddedDoc as $document) { $document ='##FILE_CONTENT##'; }
  10. Can you set a variable like so: Function something(bob = true) { }
  11. I have a table for that we will enable products and a fieldname in another table I reference that field name. How can i query the the product table to get the fieldname if enabled and then pull for the other table where fieldname matches.
  12. I tried doing that and it will not work.
  13. This seems to be working: $xml = preg_replace("/(<\/?)(\w+)[^>]*>)/", "$1$2$3", $_xmlString); $xmlstring = simplexml_load_string($xml); $json = json_encode($xmlstring); $responseArray = json_decode($json,true); Does anyone have something else i should be doing?
  14. Missed it when I copied and pasted.
  15. I can't seem to get this to parse into an array: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:getReportTestResponse xmlns:ns="http://webservice.avm.pvads.com"> <ns:return xmlns:ax21="http://webservice.avm.pvads.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax21:WSReportBean"> <ax21:confidence /> <ax21:dateStamp>12/07/2007</ax21:dateStamp> <ax21:html>adsasdasdsadasd</ax21:html> <ax21:pdsReference /> <ax21:product>AVi (Exterior AND Interior Inspection) - 48hr RUSH</ax21:product> <ax21:sourceData /> <ax21:successful>true</ax21:successful> <ax21:value>168000.0</ax21:value> </ns:return> </ns:getReportTestResponse> </soapenv:Body> </soapenv:Envelope Tried simplexml_load_string and comes back with nothing. Any help would be great thanks.
  16. Thank you I took your suggestion and made the better array. Yes works much much better thank you!
  17. I have an array and want to generate a table for each data set that has the same product name. Completely drawning a brain fart on this one. Array ( [0] => Array ( [product] => Array ( [name] => 1004 URAR [county] => KENT [mean] => 366.67 [median] => 375.00 [mode] => 375.00 ) ) [1] => Array ( [product] => Array ( [name] => 1004 URAR [county] => NEW CASTLE [mean] => 360.00 [median] => 375.00 [mode] => 375.00 ) ) [2] => Array ( [product] => Array ( [name] => 1004 URAR [county] => SUSSEX [mean] => 378.57 [median] => 375.00 [mode] => 375.00 ) ) [3] => Array ( [product] => Array ( [name] => 1004 URAR W MC & UAD [county] => KENT [mean] => 0.00 [median] => 0.00 [mode] => 0.00 ) ) [4] => Array ( [product] => Array ( [name] => 1004 URAR W MC & UAD [county] => NEW CASTLE [mean] => 0.00 [median] => 0.00 [mode] => 0.00 ) ) [5] => Array ( [product] => Array ( [name] => 1004 URAR W MC & UAD [county] => SUSSEX [mean] => 0.00 [median] => 0.00 [mode] => 0.00 ) ) [6] => Array ( [product] => Array ( [name] => 1073 CONDO [county] => KENT [mean] => 370.83 [median] => 375.00 [mode] => 375.00 ) ) [7] => Array ( [product] => Array ( [name] => 1073 CONDO [county] => NEW CASTLE [mean] => 305.65 [median] => 375.00 [mode] => 375.00 ) ) [8] => Array ( [product] => Array ( [name] => 1073 CONDO [county] => SUSSEX [mean] => 375.00 [median] => 400.00 [mode] => 400.00 ) ) ) So i want a new table when the ['product']['name'] doesn't match. Any suggestions, thanks in advance
  18. I was just about to ask if it is a datetime field, anyways thanks that worked.
  19. Sorry I was doing some testing and copied the wrong query. If I break it out for todays date I get results if I do it with CURDATE doesn't return anything.
  20. This returns no records: SELECT invoices.year, users.id, users.user_type_id, users.parent_id, users.username, users.fname, users.lname FROM invoices LEFT JOIN users ON invoices.user_id = users.id WHERE invoices.created = CURDATE() - INTERVAL 1 YEAR However this returns what it should why is that: SELECT invoices.year, users.id, users.user_type_id, users.parent_id, users.username, users.fname, users.lname FROM invoices LEFT JOIN users ON invoices.user_id = users.id WHERE YEAR(invoices.created) = 2011 AND DAYOFMONTH(invoices.created) = 2 AND MONTH(invoices.created) = 8
  21. tobeyt23

    Year Query

    I am trying to create yearly invoices for our subscribers. So what I did was create a query to compare todays date to the created date and see if it is a year old. Thought it was working but it pulls everything again on the next day, any suggestions: SELECT invoices.year, users.id, users.user_type_id, users.parent_id, users.username, users.fname, users.lname FROM invoices LEFT JOIN users ON invoices.user_id = users.id WHERE YEAR(invoices.created) <= ".(date('Y')-1)." AND DAYOFMONTH(invoices.created) <= ".date('d')." AND MONTH(invoices.created) <= ".date('m')."
×
×
  • 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.