Jump to content

iwpg

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by iwpg

  1. Thank you Barand, this is a great solution. Problem solved. I certainly appreciate it!
  2. Hi Benanamen, I need this data to use with highCharts.js, and will plot the data by month. So for example: 2016-05 Revenue: $20 2016-08 Revenue: $10 2016-11 Revenue: $50 How can I populate the empty data where no month exists in between? To chart this out in a way that makes sense, I need this: 2016-05 Revenue: $20 2016-06 Revenue: $0 2016-07 Revenue: $0 2016-08 Revenue: $10 2016-09 Revenue: $0 2016-10 Revenue: $0 2016-11 Revenue: $50 2016-12 Revenue: $0 // This month, or months after last pulled record up until now The records are coming from traffic to a website. There are 350,000 original database rows for traffic sources. I am trying to collect archived info on a monthly level. I hope that this clarifies my original post. 2016-05 Revenue: $20
  3. I have several hundred thousand records that will add a monthly db row if new data exists. I plan on working this info into a chart, but I see no reason to add values that contain 0. For 350,000 records, doing it this way reduces new monthly records to about 8,500, vs 350,000 - a huge performance improvement if this is possible. I figured that an array will help solve this. For example, looping over the data in SQL, will return something like: while ($r = $result->fetch_assoc()){ $id[] = $r["id"]; $revenue[] = $r["revenue"]; // Revenue for example $date[] = $r["date"]; // 2016-07 } So, the result will have the dates, id's and revenue stored as an array. Using ksort() will sort the dates, however is there a plausible way to add missing dates (that have 0 values)? Sorry for not being more clear, this is the best way I could describe this. I thank you for your help. DB storage is limited and expensive, and this is a critical step on the long term project.
  4. Thank you for your help, this gives me some nice direction.
  5. Sorry, I have another one as well. {"field25":["0"],"field26":["2"]} I would imagine a preg_split. I basically need to access field25 and field26 values, and turn all of them into variables. This data has me scratching my head, any help is very much appreciated.
  6. I am using a jevents plugin, RSVP pro, and am trying to access "custom_rsvp_capacity" that has a value in this case of 55. Not sure where to start, since this is not a typical set of data. Thank you. Raw: a:45:{s:3:"UID";s:32:"c0c158647d172fafbe9bb23b48b";s:11:"X-EXTRAINFO";s:0:"";s:8:"LOCATION";s:1:"8";s:11:"allDayEvent";s:3:"off";s:7:"CONTACT";s:0:"";s:11:"DESCRIPTION";s:1096:"Discovery Center";s:12:"publish_down";s:8:"2016-9-1";s:10:"publish_up";s:8:"2016-9-1";s:13:"publish_down2";s:8:"2016-9-1";s:11:"publish_up2";s:8:"2016-9-1";s:7:"SUMMARY";s:17:"Falls";s:3:"URL";s:0:"";s:11:"X-CREATEDBY";i:1135;s:7:"DTSTART";i:1472738400;s:5:"DTEND";i:1472745600;s:5:"RRULE";a:5:{s:4:"FREQ";s:4:"none";s:5:"COUNT";i:1;s:8:"INTERVAL";s:1:"1";s:14:"IRREGULARDATES";a:0:{}s:5:"BYDAY";s:24:"+1TH,+2TH,+3TH,+4TH,+5TH";}s:8:"MULTIDAY";s:1:"1";s:9:"NOENDTIME";s:1:"0";s:7:"X-COLOR";s:0:"";s:9:"LOCKEVENT";s:1:"0";s:20:"custom_upload_image1";s:28:"57bc596ab96872.78000912.jpeg";s:26:"custom_upload_image1_title";s:26:"image-coming-soon-comp.png";s:19:"custom_upload_file1";s:0:"";s:25:"custom_upload_file1_title";s:0:"";s:16:"custom_rsvp_evid";s:2:"13";s:29:"custom_rsvp_allowregistration";s:1:"1";s:18:"custom_rsvp_params";s:0:"";s:25:"custom_rsvp_sessionaccess";s:2:"-1";s:32:"custom_rsvp_sessionaccessmessage";s:0:"";s:20:"custom_rsvp_capacity";s:2:"55";s:27:"custom_rsvp_waitingcapacity";s:1:"0";s:20:"custom_rsvp_template";s:2:"15";s:29:"custom_rsvp_allowcancellation";s:1:"0";s:24:"custom_rsvp_allowchanges";s:1:"0";s:22:"custom_rsvp_allrepeats";s:1:"1";s:25:"custom_rsvp_showattendees";s:1:"3";s:23:"custom_rsvp_attendintro";s:118:" Total number";s:19:"custom_rsvp_regopen";s:19:"2016-08-22 12:00:00";s:20:"custom_rsvp_regclose";s:19:"2016-08-30 12:00:00";s:23:"custom_rsvp_cancelclose";s:19:"2016-09-01 10:00:00";s:26:"custom_rsvp_allowreminders";s:1:"1";s:28:"custom_rsvp_remindallrepeats";s:1:"1";s:26:"custom_rsvp_remindernotice";s:2:"24";s:27:"custom_rsvp_remindersubject";s:49:"Event Reminder : {EVENT} ON {DATE}%d %B %Y{/DATE}";s:27:"custom_rsvp_remindermessage";s:175:"Reminder template";}
  7. I am getting indexed by Google for URLs that are not linked. My worry is that this will be considered duplicate pages. Cannot find any info on rewriting numerous = signs. I would buy you a few beers if I could for the help. Thank you. Example: http://www.site.com/?rs=20&n=750====&deviate=30 needs to be this: http://www.site.com/?rs=20&n=750&deviate=30
  8. Sounds like a plan, will do. My original thinking was that regex would be faster than parse_url based on some past experiences. Thank you!
  9. Hello, I am trying to replace a url and add a sub-id to it, however I'm not quite there. Any help is always appreciated here. In the end, I would like the value of gotoUrl to have the cpId 123abc45 attached to it. I.E. http://example.com/?Aff=56732&SID=123abc45 http://example.com/?Aff=56732&uv=123abc45&product=1834234 http://example.com/?Aff=56732&cid=123abc45&ace=2gs244s3 $gotoUrl = "http://example.com/?Aff=56732&SID="; // OR could be listed as such: // $gotoUrl = "http://example.com/?Aff=56732&uv=default&product=1834234"; // $gotoUrl = "http://example.com/?Aff=56732&cid=&ace=2gs244s3"; // Will attach this to replace value $cpId = "123abc45"; // Possible sid replacements, depending on the url $sidList = array("sid","SID","cid","uv"); if ($gotoUrl){ foreach($sidList as $sidVar){ if (preg_match("/$sidVar/i", $gotoUrl)){ $gotoUrl = preg_replace("#{$sidVar}(?=.*\d)(?=.*[a-z])(?=.*[A-Z])$#", "{$sidVar}={$cpId}", $gotoUrl); } } echo $gotoUrl; }
  10. Works perfect, also added ksort() to the arrays to get them back in order.
  11. I went through the array manuals first at php.net. Didn't catch this one. Thanks for helping me out, I truly appreciate it! Mike
  12. I am seeing it, on Chrome, FF, IE. It could be a CSS file? Sorry I couldn't help.
  13. I'm starting to come to thoughts of a conclusion. Would it be feasible to check the first and last dates of each array, iterate through the range and then check it with strtotime + 1 month?
  14. I don't think that this would have anything to do with it, but value="Update" has a space after =. Also, you can remove the loop since it's just one record. <div id="editProvider" class="modalEdit"> <div> <a href="#close" title="Close" class="close">X</a> <p>Current Provider for: <?php $row = mysqli_fetch_array($result); echo $row['firstname'] ." " . $row['lastname'] . " is " . $row['assignedcounselor'] . "<br>"; ?> <p>Select a New Provider"; <form action="editClient.php" method="post"> <select name="assignedCounselor"> <option value="Dr. Dolittle">Dr. DoLittle</option> <option value="Mr. Magoo">Mr. Magoo</option> <option value="Jerry Atric">Jerry Atric</option> <option value="Sheldon Cooper">Sheldon Cooper</option> </select> <input type="submit" value="Update"> </form> </p> </p> </div> </div>
  15. The code that you are using should work with ID's. I highly recommend using this for any type of match. If you don't already have an ID associated with tournaments, use auto increment when creating it. echo "<td><a href='tournament.php?id=".$info['id']."'>" . $info['tournament'] . "</a></td>"; $tournamentId = $_GET['id']; $data = mysql_query("SELECT team1,score1,team2,score2 FROM smite where tournament='$tournamentId' LIMIT 1;") or die(mysql_error());
  16. If you look at your html code that's produced, you should notice that the form was printed for every loop! The format of your form doesn't need a loop, so you can put it above or below it. <div id="editProvider" class="modalEdit">"; <div> <a href="#close" title="Close" class="close">X</a>"; <p>Current Provider for: <?php while ($row = mysqli_fetch_array($result)) { echo $row['firstname'] ." " . $row['lastname'] . " is " . $row['assignedcounselor'] . "<br>"; } ?> <p>Select a New Provider"; <form action="editClient.php" method="post"> <select name="assignedCounselor"> <option value="Dr. Dolittle">Dr. DoLittle</option> <option value="Mr. Magoo">Mr. Magoo</option> <option value="Jerry Atric">Jerry Atric</option> <option value="Sheldon Cooper">Sheldon Cooper</option> </select> <input type="submit" value ="Update"> </form> </p> </p> </div> </div>
  17. Just dont know where to start, any guidance is greatly appreciated. I have a charting program that can produce 2 array sets for different data and print it using the same time period/date. The problem that I have is there are some queries that produce missing dates (there is no data in this case). This shifts the array over into the wrong date. I added the dates to the array to compare, but I really don't know what to do with it. I thought about using array_merge, but Data1 needs to check Data2 values, and then backwards so the dates match (Year-Month). I know the array is a mess due to this, and re-writing it may be out of the question since there are thousands of records with similar info. Data 1:Array ( [2012-04] => 14869 [2012-06] => 3214 [2012-07] => 5686 [2012-08] => 3937 [2012-09] => 4375 [2012-10] => 3049 [2012-11] => 2141 [2012-12] => 1685 [2013-01] => 1697 [2013-02] => 125 [2013-03] => 155 [2013-06] => 235 [2013-07] => 171 [2013-08] => 202 [2013-09] => 15 [2013-10] => 463 [2013-11] => 846 [2014-01] => 2617 ) Data 2:Array ( [2012-03] => 77250 [2012-04] => 66318 [2012-05] => 47291 [2012-06] => 54074 [2012-07] => 59331 [2012-08] => 65867 [2012-09] => 60705 [2012-10] => 67843 [2012-11] => 59960 [2012-12] => 58008 [2013-01] => 69416 [2013-02] => 60929 [2013-03] => 52830 [2013-04] => 47863 [2013-05] => 41873 [2013-06] => 37582 [2013-07] => 43731 [2013-08] => 45229 [2013-09] => 4486 [2013-10] => 45473 [2013-11] => 45706 [2013-12] => 54593 [2014-01] => 66230 ) A little more clarification, both arrays should have matching dates, if either is missing dates, the date should be taken from the other array and assigned 0 for it. This is what I would like the end result to be: Data 1:Array ( [2012-03] => 0 [2012-04] => 14869 [2012-05] => 0 [2012-06] => 3214 [2012-07] => 5686 [2012-08] => 3937 [2012-09] => 4375 [2012-10] => 3049 [2012-11] => 2141 [2012-12] => 1685 [2013-01] => 1697 [2013-02] => 125 [2013-03] => 155 [2013-04] => 0 [2013-05] => 0 [2013-06] => 235 [2013-07] => 171 [2013-08] => 202 [2013-09] => 15 [2013-10] => 463 [2013-11] => 846 [2013-12] => 0 [2014-01] => 2617 ) Data 2:Array ( [2012-03] => 77250 [2012-04] => 66318 [2012-05] => 47291 [2012-06] => 54074 [2012-07] => 59331 [2012-08] => 65867 [2012-09] => 60705 [2012-10] => 67843 [2012-11] => 59960 [2012-12] => 58008 [2013-01] => 69416 [2013-02] => 60929 [2013-03] => 52830 [2013-04] => 47863 [2013-05] => 41873 [2013-06] => 37582 [2013-07] => 43731 [2013-08] => 45229 [2013-09] => 4486 [2013-10] => 45473 [2013-11] => 45706 [2013-12] => 54593 [2014-01] => 66230 )
  18. Thank you requinix! I'm starting to get the picture! I appreciate the help.
  19. Hello, I am having issues assigning an array value to a variable. Simple enough, I get $bidStrategy with a value of MANUAL_CPC fine, however the $bid variable is too complex for me. Thank you! I hate to ask and don't want to cheat, but does anyone know of a tool that will give you these variables from an array? I have a lot of this going on in the code that I need to solve with little time to dedicate. foreach ($page->entries as $adGroupCriterion) { $bidStrategy = $adGroupCriterion->biddingStrategyConfiguration->biddingStrategyType; $bid = $adGroupCriterion->biddingStrategyConfiguration->bids->CpcBid->bid->Money->microAmount; } The Array: [biddingStrategyConfiguration] => BiddingStrategyConfiguration Object ( [biddingStrategyType] => MANUAL_CPC [biddingScheme] => ManualCpcBiddingScheme Object ( [enhancedCpcEnabled] => [BiddingSchemeType] => ManualCpcBiddingScheme [_parameterMap:BiddingScheme:private] => Array ( [BiddingScheme.Type] => BiddingSchemeType ) ) [bids] => Array ( [0] => CpcBid Object ( [bid] => Money Object ( [microAmount] => 3500000 [ComparableValueType] => Money [_parameterMap:ComparableValue:private] => Array ( [ComparableValue.Type] => ComparableValueType ) ) [contentBid] => [cpcBidSource] => ADGROUP [BidsType] => CpcBid [_parameterMap:Bids:private] => Array ( [Bids.Type] => BidsType ) ) ) )
  20. Hallelujah!!! - The problem is solved! It certainly looks like OpenSSL was the issue, something to do with permissions/RPM on the Centos server. http://httpd.apache.org/docs/current/platform/rpm.html Last night Cpanel made an update to the PHP Pear package (cpanel-php53-PEAR-1.9.4-3.cp1136.src.rpm) and it fixed the issues related to cURL, but not fopen via SSL. At least I'm able to download via cURL now. On the new server that I set up, I was able to generate these errors (for whatever reason, the main server did not generate any output, with error reporting enabled). Warning:SSL: Connection reset by peer Warning: fopen(): Failed to enable crypto It sounds like 64-bit versions of Centos/PHP is known for issues with OpenSSL based on some articles that I came across. http://stackoverflow.com/questions/18098258/64-bit-linux-ubuntu-and-openssl-issue-could-not-read-symbols-bad-value I hope that this can help prevent somebody for not going through what I did! Thanks for all the help with this, almost in tears now! LOL
  21. Hi Kicken, good idea. Curl and wget both resolve! This helps out quite a bit. Thanks!
  22. Me neither, and I really appreciate Barand's, Mac_Gyver's and your help. I cannot confirm if the server is blocked or not. This is Microsoft we're talking about, so I decided to order a temporary machine to test this, instead of possibly waiting weeks or months for no answer. It would be nice to know if this is server/ip/datacenter related or not. $115 bucks for a month's of extra hosting is worth it at this point to find out where to look next.
  23. Hi Jazzman, the state is "disabled".
  24. No error, nothing. Just an empty screen. I turned off output buffering, and also ran the code that you gave me. I am using Centos 6.4 (64 bit) with Apache 2.2.26, PHP 5.4.23
  25. Hi Jazzman1, I moved servers, but I pretty much have the same setup. I downgraded Apache and PHP to mirror the old one, but still no luck. This is the code that I used to test, it should return the 404 page that is there (the actual zip file gets deleted after 5 minutes). This works on my old server fine. Changing the URL and removing the "download" subdomain works, it returns the 500 error page. Attempted to download content from https://download.api.bingads.microsoft.com/ReportDownload/Download.aspx and wrote it to <a href="log_microsoft.txt">this text file</a> <?php $fileName = "log_microsoft.txt"; $downloadURL = "https://download.api.bingads.microsoft.com/ReportDownload/Download.aspx"; $handleOut = fopen($fileName, "w"); $handleIn = fopen($downloadURL,"r"); while (!feof($handleIn)){ $content = fread($handleIn, 8192); print_r ($content); fwrite($handleOut,$content); } fclose($handleIn); fclose($handleOut); ?>
×
×
  • 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.