Skip to content

How to mirror an array recursively?

I have a tree from the youngest to the oldest I need to mirror it (turn it inside out, if I may say so) to get such a structure I’ve been working on this task for quite a long time and I can’t think of an algorithm to do it. What should I do to get the second option while

Get Possible Order Date Based On Multiple Conditions

I can’t wrap my head around this particular problem. There is a bakery, and an office that accepts orders. Bakery is open from Monday to Sunday, it’s only closed during public holidays. Orders can be placed from Monday to Friday unless it’s a public holiday i.e. the office is open during wor…

How to change Eloquent Builder’s connection?

I have a Eloquent Builder and two database connections(mysql_server1, mysql_server2) as below: Now how can I change the connection of $builder? Any helps would be appreciated Answer Need to get the Query from Eloquent Builder and set a new connection to that and set the new query to the Eloquent Builder as be…

Add New Record Value, & Previous Record Value MySQL

I am busy creating a new table in my DB, and have some issues populating the correct values. The table consists of a number of columns Using the UPDATE ON DUPLICATE KEY, is not an option here, as I need to keep each and every record, however, adding only the previous value to the new record. Existing Query: H…

How to pass the id of a client by a html button in javascript

here’s my problem: I’m making a client system in javascript and php. I would like to be able to delete the account of a customer who has a unique identifier (id=x) by clicking on a “Delete Customer” button. The problem is that to bring a little dynamism, I treat the request in javascript in this way: My reque…