Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About justinbriggs1

  • Rank
  • Birthday 09/12/1979

Profile Information

  • Location
    Richmond, VA
  1. OK, here is one answer. I take no credit for figuring this out by the way:SELECT main.*, MAX(CASE WHEN node_name = 'urgency' THEN node_value END) AS urgency, MAX(CASE WHEN node_name = 'name' THEN node_value END) AS name, MAX(CASE WHEN node_name = 'phone' THEN node_value END) AS phone, MAX(CASE WHEN node_name = 'location' THEN node_value END) AS location, MAX(CASE WHEN node_name = 'department' THEN node_value END) AS department, MAX(CASE WHEN node_name = 'cc' THEN node_value END) AS cc, MAX(CASE WHEN node_name = 'status' THEN node_v
  2. That's a good question. I don't see any reason why I couldn't get the results in a different format and then modify the data as needed with PHP. That might actually be optimal since I'd rather not rewrite any major data structures. I am still, however, at a loss for ideas at this time. Do you have any suggestions? And also, have you seen anything like this before? I'm not sure if the last developer was doing some "experimenting", but this is not really the way I would normally do things.
  3. Hey yall, I got a horrible mess of a query, was wondering if anyone could take a look at it and let me know of any suggestions of how to clean it up. It works, but it runs slowly after too many records are in there. It only involves two tables, but the query basically takes values from rows in the problem_nodes table and turns them into columns for the final result.SELECT * FROM (SELECT urgency,name,phone,location,department,cc,status,case_manager,ip,case_manager_eid,id_problem,id_problem_type,eid_author,title,body,date_created,date_modified FROM problems AS main INNER JOIN ( SELECT id_problem
  4. Hey all, I've been tasked with cleaning up a query due to the delay we are getting with the results. My question is, how do I create a select statement which will return row values as column names?For example:Here is how the table is currently configured. Sorry it looks so jacked up, the column names are in brackets, with the corresponding rows below.[id_problem] [node_name] [node_value]2----------------urgency--------Whenever2------------------name-------A. Aaronson 2-----------------phone---------555-5555I would my select statement to return something like this:[id_problem]------[urgency]---
  5. I'm not sure I understand, which table are you referring to in your answer? Also, it seems like if your solution would produce redundant data, which is what I was trying to avoid. Could you elaborate?
  6. Hey everyone, I am trying to delete across 3 tables without affecting the reliability of the data, but am having a tough time figuring out how. I'm sure there is a standard way of doing this with SQL or the application code (PHP in my case). Here is a short description of my tables:Candidate_table - id_candidate - namePosition_table - id_position - titleRelationship_table - id_position - id_candidate I want to delete the position, and all of the candidates associated with that position. Deleting the Position rows and the Relationship rows are easy:DELETE FROM Position_
  7. Great, thanks for your help again that worked perfectly.
  8. Thanks for the reply. I'm not really worried about any HTML formatting besides line breaks. It can be very rudimentary, for instance this would certainly suffice: ["logintimeremaining"]=> "2"["account"]=> "left/2008-05-10"["department"]=> "Specialty Pool" etc.I just can't seem to figure out how to arrange my loop to only print out the relevant key/value pairs. Also, I didn't mentioned before but the previous example was formatted with <pre> tags; otherwise it just outputs as a normal array dump style.
  9. Hey everyone, I have an array result that I am having a difficult time formatting to a more human-readable format.Here is the an example, it came from an LDAP query: array(2) { ["uid=tthompson,ou=People,dc=abc,dc=com"]=> array(7) { ["logintimeremaining"]=> string(1) "2" ["account"]=> string(15) "left/2008-05-10" ["department"]=> string(22) "Specialty Pool" ["affiliation"]=> string(15) "former-it" ["displayname"]=> string(13) "Tom Thompson" ["mail"]=> string(16) "tthompson@abc.com" ["uid"]=> string(8) "tthompson" } ["uid=ttomlin,ou=People,dc=abc,dc=com"]=> array(
  10. This is what I was looking for. just didn't set the second parameter correctly:UPDATE student_apps_copy SET submitdate = STR_TO_DATE(submitdate,'%m/%d/%Y')
  11. Hey everyone, just a quick question. I am attempting to convert some string values intoa date format, but I can't seem to figure out how to do it with one statement. Here is what I have:UPDATE student_apps_copy SET submitdate = STR_TO_DATE(submitdate,'%d,%m,%Y')This doesn't work obviously, but maybe you can see what I am trying to do.Any help would be appreciated.
  12. Hey everyone, I am messing around with the arrayList class, and I am having a bit of trouble.arrayList utilizes an object buffer to keep track of the class elements. How do I extract the last variable from the buffer? This is obviously pretty easy if it is cast to an array, but I can't figure it out with an object.Also, is there a way to extract an object variable at a specified index?Thanks, really confused, any help would be appreciated.
  13. Hey everyone, I just installed xampp on my windows 7 machine, but I forgot that I had previously installed another web server when I was experimenting with the Zend framework. I deleted all of the Zend files since I didn't need them, but now I forgot how to configure localhost to point to my new xampp server (I'm getting an unable to connect error). Any help would be appreciated.UPDATE:OK, I tried restarting the new apache server and then used instead of localhost, and it works now. But still doesn't work for locahost. Anyone know how I update this accordingly? Thanks.
  14. Hey everyone, I've been having an issue sending an email in a PHP script using the regular PHP mail function, and the wpmail Wordpress function. I can send e-mails to almost every e-mail address I can think of, and it works fine, but when I try to send it to my clients e-mail, nothing happens, doesn't even get sent to the junk folder. The e-mail in question is one on their own server, like john.smith@mywebsite.com.I could usually just test my way through this, but the client does not want to provide me with a test e-mail account. What is the best way to verify that each e-mail is going to be s
  15. Looks like you didn't use a closing div tag around your images. Are you trying to do this?: <div style="position: absolute; width: 516px; height: 29px; z-index: 1; left: 280px; top: 560px;" id="specials"> <img alt="" src="images/daily_specials.jpg" width="516" border="0" height="29"></div><div style="left: 0px; top: 0px; width: 161px; height: 41px; z-index: 2; position: absolute;" id="rueben"> <img alt="" src="images/grilled_rueben_btn.jpg" width="161" border="0" height="41"></div>
  • Create New...