I am working on a project that requires me to generate a report based on purchased rentals. I have to keep a count for each type of rental and sum the corresponding totals. Currently I am using a …
Tag: php
I have some trouble with PHP sha256 Hash [closed]
I want to hash the user input and save it in a database but i only safe the same hash every time no matter what password i enter in. Why is this so ? i know that the function return the hash as …
Is there a name for this ‘pattern’?
I recently encountered a situation where it was useful to create a lazy-loading version of a class by wrapping its factory. I’d like to do some research to find out if there are any issues I hadn’t …
Problem loading a library with FFI in PHP 7.4
I’m having trouble using a third party .so library in PHP with the new FFI. When I run this little piece of code: PHP outputs me this error: Is this a problem with the library itself, my PHP configuration or something else? It’s confusing to me, because I can use normally this same library with th…
WordPress function get_post_gallery() does not register post’s gallery
I want to extract the images contained in a gallery block while maintaining their correct order. Since get_children() and get_attached_media() do not seem to register when the image order is changed …
Generate a Paseto V2 Public Key/Token in PHP, Verify in Node.js
Preface: What is Paseto?: https://developer.okta.com/blog/2019/10/17/a-thorough-introduction-to-paseto I am using the PHP library for Paseto from here I am using the Node.js Paseto lib from here I have been able to successfully achieve the creation of a Paseto V1 token and corresponding public key using the P…
insert data from while loop into database php
I am trying to post data into my database from these while loop. It helps me get the monthly periods within a particular range. I want to pick the dates and input the dates into my database along with …
PhpUnit How to test double a method using both other class and self class methods?
So I want to test double my function doEverything like so : class MyClass { protected secondClass; public function __construct( SecondClass $secondClass; ) { $this->…
How i persist data with @ManyToMany Symfony4
I have problem when I want import data (csv) officer with relation ManyToMany Department : the officer (agent in french) are store but the relation are not created (table agent_departement). Agent …
make output from array with same keys from the database
I get the information from the database. For example, my database data is as follows: I get the information from the database. For example, my database data is as follows: —————————-…