I create a quick route that triggering an fn that runs shell_exec() to back up my database. To save server space, I also want to zip what I dumped I’m not sure why the zip command never runs even if I put a sleep() after the first one, and in betweens. What did I do wrong? Note : the tar
Working with Doctrine array of enum and store it in a separate table
I’m currently building Entity model and one of my Doctrine Entities have ManyToMany relation with an external dictionary (like ENUM). So the entity field will be an Array of Enum. I’m looking for a way to have it as an array field on my entity, but to store it as a separate DB table. Would like to…
Combine multiple arrays and covert to string
I have two fields first_name last_name Both are arrays. I would like to combine the arrays and covert to a human readable string. How can I achieve this? Here is where I’m at: $firstName = …
Login timeout expired with PDO sqlsrv connection. Able to query with TSQL just fine from same RHEL 8 client
I’m getting “Login timeout expired” with the following connection attempt: If I add LoginTimeout: The script returns a Bad Gateway error. I’m at my wits end and am unsure what I’m missing. Details below. This is a RHEL 8.3 system with PHP 7.4.6 installed. RemoteSQLServer is a rem…
sum of amount in all mysql table names from array
I have 6 mysql tables in my database. and each table contains column ‘amount’ I want sum of all amounts in all tables. But getting error as Invalid argument supplied for foreach() in // foreach ($…
execute php page that unzip a file (manipulate files)
Im using a local (rhel 8) server to unzip a file using php (solution proposed in : https://stackoverflow.com/a/8889126/9583635) <?php // assuming file.zip is in the same directory as the executing …
How can I change the selected option in select atribute using the php value that i have?
I want my select atribute to change it’s selected option depending on php $choice. For example if I chose FOOD ASC (it’s option 1) i want to make it selected after i press the button with name “sortbutton” HTML Answer I assume , the next page renders the same form again doing above on …
Retrieving data from pivot table in Laravel only using one foreach loop
I have created the 3-way pivot table for Users, Shifts, Patterns. It is called pattern_shift_user. [pattern_shift_user.][1] It refers to the three models via many to many relationships here’s a view of the user model that links the pattern model and shift model [User Model][2] I have done the same for e…
Symfony access headers in custom validator constraint
I am trying to access the headers of my request in a custom validator constraint like so: But the headerBag in $this->request is always an empty array unfortunately. Is there maybe an issue because I extend the symfony count validator? Answer You should ingest RequestStack instead of Request See the docume…
Laravel list with unique values and count of values
Im trying show unique values from database with count of them in table view. But i have problem count them. my goal is show in table my controller dd($userList) show 1 john and 1 smith dashboard.blade error : Call to undefined method stdClass::count() Answer Use this code: And in your blade use this code: