
kenw232
Members-
Posts
23 -
Joined
-
Last visited
Everything posted by kenw232
-
thats what I need, awesome. thanks.
-
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
-
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?
-
How do I track an integer for an unknown string?
kenw232 replied to kenw232's topic in PHP Coding Help
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; -
How do I track an integer for an unknown string?
kenw232 replied to kenw232's topic in PHP Coding Help
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"; } -
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.
-
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?
-
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?
-
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?
-
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
-
Thank you for the help.
-
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.
-
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