Jump to content

kenw232

Members
  • Posts

    23
  • Joined

  • Last visited

kenw232's Achievements

Member

Member (2/5)

0

Reputation

  1. yes, thats the problem. eg. <subfile name="Detail"> <detail> <detail.sequencenumber system="true">3736939</detail.sequencenumber> <detail.lastmodifiedtime system="true">20200512123958</detail.lastmodifiedtime> <detail.parentseq system="true">321595</detail.parentseq> <detail.sort system="true">1</detail.sort> <detail.account>6000031-</detail.account
  2. echo '<td>' . $xmlLineItem -> detail.description . '</td>'; I'm trying to do the above. It won't work because of the . in "detail.description". what do I do?
  3. Its ok, I figured it out. I'm tracking it in two different arrays. # Add employee to array if not in array already if (!in_array($sqlEmployeeRow['employee_name'], $aTimeTotal)) { $aTimeTotal[] = $sqlEmployeeRow['employee_name']; } # Get index of this employee and update second array with time value $iIndexTemp = array_search($sqlEmployeeRow['employee_name'], $aTimeTotal); $aTimeTotalVals[$iIndexTemp] = $aTimeTotalVals[$iIndexTemp] + $sMinsOut;
  4. I have a while loop of mysql results. I need to keep track of the total number of X for employee_name's. How do I do that? while ($sqlEmployeeRow = $sqlGetEmployees -> fetch()) { // "This" employee_name gets 5 added to it's x. echo $sqlEmployeeRow['employee_name'] . " now has " . $x . " minutes"; }
  5. I have a variable with a string that changes in a loop. while { $Name = "unique name1"; $Name = "unique name2"; $Name = "unique name3"; } I want to dynamically update a unique integer associated with $Name. How can I do this? So "unique name1" might get a number of 34, but I don't know the string will be "unique name1" entering into the loop. I can't wrap my head around this.
  6. If I set a custom timezone with date_default_timezone_set('Etc/GMT+4'); will the time change by 1 hour on Nov 6, 2016 when Daylight savings ends or stay the same?
  7. Yes, I'm saying EST simple as in new york time. Now when DST comes around on Nov 6, 2016 I do not want the time turned back 1 hour and therefore the time reported by the PHP date() command on this specific web site to stay the same. possible?
  8. I'm running PHP 5.6. I set my web sites time zone with: date_default_timezone_set('America/Toronto'); This works fine and my site says the proper EST time with the date() command. I then check if daylight savings time is on with: echo date('I'); And it says "1" which means it is on. I need it off. I need to set my web site to EST with no daylight savings time. I do not have access to my php.ini. It has to be done via code. How can I do that? Does anyone know?
  9. Can someone tell me how to get this [date] into a string variable? I'm not smart. Thanks. print_r($aContactToImport[LastUpdated]); Gives: DateTime Object ( [date] => 2016-05-04 12:08:18.000000 [timezone_type] => 3 [timezone] => UTC ) echo $aContactToImport[LastUpdated][date]; Gives: Fatal error: Cannot use object of type DateTime as array in whatever.cgi on line 123
  10. I need to sort the results of a select but there is no field to sort by in the table. So "order by" can't be used. This is because I have a couple fields (lattitude and longitude) that I have to use to calculate distance after the select, I cannot store the distance field in the same table ahead of time. mysql (root in 'CMS'): select * from Table; +-------------+ | account_num | lat | long ... +-------------+ | 16 | .. | 22 | ... +-------------+ Is it possible to take the results of the above, do my calculation (in PHP 5.5) against lat/long to get x, then somehow add this x (distance) to each row then resort based on it? mysql version: 5.1.46.
  11. I'm just an beginner SQL guy and can't figure out how to do this. Of if its even possible. This select gets a list of the hotels that are assigned to a given event, in this case event number 78: select * from EventsHotels, Hotels where EventsHotels.event_num = '78' and EventsHotels.hotel_num = Hotels.hotel_num and Hotels.active = 'on' order by Hotels.hotel_num; Returns something like: +-----------+---------------------------+ | hotel_num | many more columns| +-----------+---------------------------+ | 58 | many values + | 59 | many values + | 77 | many values + +----------------------------------------+ This separately gets the number of rooms free for give hotel. In this case hotel 77: select sum(room_type_1 + room_type_2 + room_type_3 + room_type_4 + room_type_5 + room_type_6 + room_type_7 + room_type_8 + room_type_9 + room_type_10 + room_type_11 + room_type_12) as total_rooms from HotelsInventory where inv_date >= '2015-12-01' and inv_date < '2015-12-31' and hotel_num = '77'; +-------------+ | total_rooms | +-------------+ | 5 | +-------------+ The objective is to simply combine the two statements into one large SQL statement and sort by total_rooms. Anyone know how to do this? MySQL 5.1.46
  12. Ok, I got it. Even the files had to be UTF8. I didn't know plain text files were this specific now.
  13. I have <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> at the top of my html page that does the str_replace. And I can save in UTF8 format right into a mysql database if I try. I just see no way to get str_replace, or anything else to replace special word characters first. They are always ignored. This works: echo str_replace("T", "replace", $_REQUEST["variable"]); // Normal ASCII T character This does not: echo str_replace("…", "replace", $_REQUEST["variable"]); // where ... is that special word character
×
×
  • 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.