Jump to content

ShadowMage

Members
  • Content Count

    3,436
  • Joined

  • Last visited

Community Reputation

94 Excellent

About ShadowMage

  • Rank
    Faal Vokundovah
  • Birthday 08/27/1867

Profile Information

  • Location
    America's dairyland
  • Interests
    I dabble in a little bit of everything. Gaming, programming, web development, fishing, paintballing, woodworking, farm equipment, reading, nature......

Previous Fields

  • Languages
    (X)HTML, CSS, JavaScript, PHP (though I still have much to learn)

Recent Profile Visitors

55,691 profile views
  1. ShadowMage

    Join Using LIKE

    Well, adjusting my join to use syntax like that I now get this error: I suspect that this is due to what I mentioned previously about there being multiple possibilities to join on and it doesn't know which to use. It looks like I might just have to find a different way to get the information I need (multiple queries and looping through them in PHP perhaps). Thanks, JSG!
  2. ShadowMage

    Join Using LIKE

    The best I've been able to come up with so far is something like this: SELECT OrderHed.OrderNum, OrderHed.SalesRepList, SalesRep.SalesRepCode, SalesRep.Name FROM OrderHed INNER JOIN SalesRep ON OrderHed.Company = SalesRep.Company AND LCASE(LEFT(LTRIM(OrderHed.SalesRepList, '~'), (INSTR(LTRIM(OrderHed.SalesRepList, '~'), '~')-1))) = LCASE(SalesRep.SalesRepCode) WHERE (SalesRep.SalesRepCode = 'ABC') which works, but only returns records if the rep is the first one in the list. Ie, it'll return an order where rep list is "ABC~DEF" but not one where rep list is "DEF~ABC".
  3. ShadowMage

    Join Using LIKE

    lol. They'll tell me to go to their Yahoo user group. Been there done that. Anyways, no the codes are not the same length and yes there could be codes that are subsets of others. They are user generated codes and typically some abbreviated form of a company name.
  4. ShadowMage

    Join Using LIKE

    Hey guys, I have the following SQL statement: SELECT OrderHed.OrderNum, OrderHed.SalesRepList, SalesRep.SalesRepCode, SalesRep.Name FROM OrderHed INNER JOIN SalesRep ON OrderHed.Company = SalesRep.Company AND LCASE(OrderHed.SalesRepList) LIKE CONCAT('%', LCASE(SalesRep.SalesRepCode), '%') WHERE (SalesRep.SalesRepCode = 'ABC') Where OrderHed.SalesRepList is a delimited list of codes in the format "ABC~DEF~GHI" and order is not always the same. I realize this is bad design, but I have no control over the database design (it's Epicor) so I just have to work with what I've got. I need to be able to join the OrderHed table and the SalesRep table on that list of codes. My Google searches suggest that the syntax above should work, but when I run that I get the following error: Is this a limitation on the Progress engine or am I doing something wrong? EDIT: Actually, now that I think about it, I wonder if it's failing because it's trying to create multiple joins in one. Ie, in the example rep list I gave, it would be trying to join the rep codes ABC, DEF, and GHI all at the same time. Are there any other ways around this to accomplish what I'm trying to do? Maybe a nested query of some kind (those really confuse the heck out of me...)?
  5. ShadowMage

    Specified Driver Could Not Be Loaded

    Seems like that was the problem. Apparently Everyone doesn't include the IUSR... I couldn't find a way to add the IUSR account to the share in AD, but I did figure out how to change the account used in anonymous authentication in IIS.
  6. ShadowMage

    Specified Driver Could Not Be Loaded

    Maybe a silly question, but how and where do I find the IIS account? I see a group called IIS_IUSRS but there's no members.
  7. I'm not sure if this should go here or in PHP, but I'm having problems getting PHP to connect to a Progress DB. I have IIS installed and configured on a Windows 2008 server and all seems to be fine on that front. I can access the site, and I can run PHP code. I can also access the MySQL databases we have. When I try to access the Progress database, however, I get the following error: Warning: odbc_connect(): SQL error: Specified driver could not be loaded due to system error 5: Access is denied. (Progress OpenEdge 10.2A driver, \\share\path\to\file.dll)., SQL state IM003 in SQLConnect in C:\inetpub\phplib\ODBC.php on line 349 I created a system DSN on the webserver and I am able to successfully test connect from there. I've also added full control for Everyone on the specified DLL (and the path to get to it) and still get the access denied error. Any ideas or suggestions? Thanks in advance for any help you can offer.
  8. ShadowMage

    Trademark symbol in XML using DOMDocument

    I just echoed the xml string. Nothing else. No html tags of any kind. This script is intended to be accessed through AJAX so there is no other output (aside from any error messages if/when they occur).
  9. ShadowMage

    Trademark symbol in XML using DOMDocument

    This is the code I'm using: $doc = new DOMDocument('1.0', 'UTF-8'); $doc->loadXML($xml); // $tmp = $doc->saveXML(); $doc->save($FileLocation); The saveXML() function returns the xml code as a string. The save() function saves it to a file. When I echo $tmp, I get all the goofy characters described above. However, I just tested printing out the xml string prior to loading it into DOMDocument and it prints out just fine... Must be something with DOMDocument messing up the character encoding.
  10. ShadowMage

    Trademark symbol in XML using DOMDocument

    It seems to recognize as a valid entity at least. I know that it works in HTML. I did try using the other two you mentioned. ™ doesn't seem to work in either the browser or when I save it as a file. Shows a bunch of odd symbols in the browser and puts the entity code itself into the file where the symbol should be. Maybe that's how it's supposed to work, not sure. However, while ™ doesn't work in the browser, it does put the actual symbol (not the entity code) in the right place when saved to a file. I think I'll run with it this way for now and see if I encounter any problems.
  11. ShadowMage

    Trademark symbol in XML using DOMDocument

    As mentioned before, I haven't actually created an XML file yet. I'm just loading a string previously generated in the PHP into DOMDocument. I did try re-saving all my PHP files as UTF-8, but it didn't seem to make any difference... I also noticed that when I actually save the XML file to the filesystem, it doesn't put anything in the place where the trademark is supposed to be. No trademark, no other goofy symbols. When I output it to the browser, I get the behavior described above.
  12. ShadowMage

    Trademark symbol in XML using DOMDocument

    ok, so I tried escaping the ampersand (™) which doesn't give me an error, but it doesn't print the trademark symbol either. Just prints "™" Also tried using utf8_encode on the xml string before loading it into DOMDocument. I tried it with the chr() function and it gave me the same result as using did before (ie, the goofy 'A' symbol). Using still gives me the same result. Tried it with the actual TM character and it gave me a lot more goofy symbols than before. Didn't get any errors using utf8_encode, though!
  13. ShadowMage

    Trademark symbol in XML using DOMDocument

    I have the xml DTD included in the string I'm trying to load: <?xml version='1.0' encoding='UTF-8'?> I also tried specifying the encoding when I created the DOMDocument object: $doc = new DOMDocument('1.0', 'UTF-8'); which didn't help. I'm not working with any files yet. It just generates the string, then attempts to load it into DOMDocument. Or are you referring to the PHP script itself being saved as UTF-8? As for utf8_encode, where do I use that? On the string I'm trying to load into DOMDocument? Like this: $doc->loadXML(utf8_encode($xml)); Thanks, I didn't know that was possible. If I can't get this working any other way, I'll try creating my own entity.
  14. ShadowMage

    Trademark symbol in XML using DOMDocument

    I'm using DOMDocument to load an xml document from a string generated in PHP. One particular node needs to have a trademark symbol in it's value and I'm having trouble getting that to load with DOMDocument. First a little setup/background: I have a value stored in a database field that needs to have the trademark. This value is both displayed on screen and written to the XML. Right now I'm using placeholder text ("{TM}") and using str_replace to replace the placeholder text with the HTML entity (™) to display it onscreen. This works fine. It doesn't work when writing to XML because the ™ is not a recognized entity apparently. So, when writing to the XML I tried: $systemDesc = str_replace('{TM}', '', $arrGlazeType[$this->GlazeType]['Description']); Which sort of works. I get an extra goofy 'A' symbol, though: Guardian 275™ If I just replace the placeholder with an empty string, it displays just "Guardian 275" as I'd expect. So I tried: $systemDesc = str_replace('{TM}', '™', $arrGlazeType[$this->GlazeType]['Description']); which gives me: Guardian 275â„¢ and $systemDesc = str_replace('{TM}', chr(153), $arrGlazeType[$this->GlazeType]['Description']); which produces an error: Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Input is not proper UTF-8, indicate encoding ! Bytes: 0x99 0x3C 0x2F 0x73 in Entity, line: 19 Line 19 is where the trademark symbol should appear. You might ask "well, why are you using the placeholder anyway?" Good question. When I put the trademark symbol directly into the database, it showed up on screen as a black diamond with a question mark. The htmlentities() function didn't help. And in the XML, I get the same error as using the chr() function. I didn't think this would be that hard...
  15. It could be done with Canvas, yes, but that's much more complicated than Ingolme's suggestion (using a GIF) and wouldn't work in instances where the user has JavaScript disabled since canvas requires JavaScript to function.
×