Posts by wdarking • 553 points
14 posts
-
4
votes1
answer38
viewsQ: Is there a way to do these assignments more cleanly?
I have a class that should be started with a array property. $subscription = new CheckRenew([ 'custom_2_id' => 13, 'email' => '[email protected]', 'zip' => '90530000', 'number' =>…
-
1
votes2
answers485
viewsA: Laravel 5.3: Auto_increment jump (id) (Gaps)
As you quoted the Wallace Maxters, I have done further research on the subject and the David Spillett gave a good explanation: Why does this happen? This is not uncommon and there are a couple of…
-
1
votes2
answers485
viewsQ: Laravel 5.3: Auto_increment jump (id) (Gaps)
I did a basic CRUD using Eloquent. My problem is time to create (Create). I use the code below: public function store(Request $request) { $subscription = new Subscription; // Basic Data…
-
2
votes1
answer251
viewsQ: Difference between dates in Months for range >= 12
To find the difference between two dates, the date_diff(). $datetime1 = date_create('2016-10-11'); $datetime2 = date_create('2018-10-11'); $interval = date_diff($datetime1, $datetime2); return…
-
3
votes1
answer261
viewsQ: How to position button and . page-header in the same Row (inline)
I am using the bootstrap for a simple and helpful panel of you regarding the positioning of certain elements on the page. I would like to position the save button along with the .page-header. But…
-
12
votes2
answers4433
viewsQ: The concept of High Order Functions in Javascript
I’m reading Eloquent Javascript to have a javascript base. I was understanding well, since the fundamental does not change in relation to other languages, such as data types (int, string, bool,…
javascriptasked wdarking 553 -
1
votes2
answers827
viewsQ: Remove duplicated data and return the highest value date field
We are migrating signatures from an Access database to Mysql, but before migrating I need to process some parts of the data. I need: Remove duplicate id’s Return the highest value of the date field…
-
3
votes2
answers1092
viewsQ: Comparison between 2 equal numbers returning 'false'?
I have the following code: <?php var_dump($fullprice) ?> <?php var_dump($cart->getData('subtotal')) ?> <?php var_dump($fullprice == $cart->getData('subtotal')) ?> $fullprice…
-
2
votes1
answer238
viewsQ: Eval() PHP, usability and context
I was reading some code e-commerce extensions. Normally these modules are paid, but what I was seeing had a trial to try. I installed and went to analyze the code. I was expecting something in PHP…
-
0
votes1
answer178
viewsQ: Why doesn’t the regex work?
I’m following the playbook OOP Programming with PHP5 by Hasin Hayder (2007) and arrived at the part of Unit Tests. In given exercise, he sets up a method wordCount() and creates some tests for this…
-
1
votes1
answer804
viewsQ: How to install PHP7 in *Unix
I decided to test a Unix-like system (Linux Mint) to learn more, and I need to install PHP7, because the Phptherightway sent. I already installed apache2 via Terminal and Mysql. I know there is a…
-
3
votes1
answer302
viewsQ: When to use Exceptions in PHP?
I arrived in a module of the OOP PHP workbook on Handling Exceptions, I practiced the exercises and such, but I’m still not quite sure when I should use them, and why. I did a search and found this:…
-
1
votes1
answer620
viewsQ: Is it possible to execute multiple queries in a single run?
I needed some data from a database in mysql. However, the data were in different tables, so the most obvious solution was to filter using relational tables, with the respective indexes. But I don’t…
-
8
votes1
answer2455
viewsQ: Is the __destruct method useful?
I read about the method __destruct these two links: http://php.net/manual/en/language.oop5.decon.php https://stackoverflow.com/questions/7240230/is-the-destruct-method-necessary-for-php And I still…