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 get any advice/links/etc.
Tag: php
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 remote Windows system running SQLServer 2012. I’m able to successfully connect just to
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 the html should work. I would
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 each model, and it seems to work, the problem I
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 documentation
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:
Allow access to any order on front-end on WooCommerce
My goal is to allow certain role to view any order in shop. While displaying all orders in “My Account” page is relatively easy, accessing particular order created by different user always ends up with “Invalid order. My account” error. So far I have added custom query on woocommerce_my_account_my_orders_query filter, so that one can view all orders made by accounts
How to get multiple values from input field in jquery?
I want to get input field values which are in foreach loop using jquery . Here is the html structure I’m trying to get value in this way But In this way, I get only first-row value. How can get all rows value using jquery? Answer You have to loop through all the elements to get the values from them.
How to text-to-speech a PHP table
I’m working on a project where I have a table containing a list of students, I want my web-app to “say” their name and last names one by one, the same as when a teacher is marking who’s present or not. I dont know if the technology to go to in this situation is Javascript or PHP, although it looks
How to update multiple or single row in single query using where multiple or single id using codeigniter?
I want to update multiple or single row in database in one query where multiple ids or single id post from the form. I couldn’t find it works in update batch. I don’t know how to do it. I have already searched on google on how to make it but I have no luck. Your answer is very much appreciated.