I need to print only the records for the month of May I get them with the variable I need to see only May results, how do I do it? Answer You can use if condition or
Tag: php
Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?
i want to ask you how to select FOREIGN KEY (from “doa_id in “doas” table) when user create a new data (to the “notes table) in a form. This is my code : NoteController.php 2021_05_28_020438_create_notes_table.php migration and this is my dropdown html : In Dropdown option, I want to s…
PHP A Good way to pass the PDO Object into other Main classes
im new to PHP OOP, now i was woundering if there is a better way to use the Database Class then just extending it over all. For Example i am having 3 main classes: Employee, Customer, Article. each of this classes have a subclasses which extends form. what i have done until now is extand the Db class on each
Eloquent “where” on relationship returns wrong models
I have this method on my model “Employer”: I thought it would work fine, but it ends up giving me models that aren’t even related to my Model. Like, the id of the model is 37 and it gives me the relationships of all the models (like id 6). Any idea of why this would happen? Answer I think yo…
How do I manage read and write AWS Aurora host endpoints in CakePHP?
I am working with a CakePHP based API that utilizes AWS Aurora to manage our MySQL database. The CakePHP application has many large read queries that that requires a separate Reader Endpoint to not exhaust the database resources. The way this works is that AWS gives you separate endpoints to use in the host f…
Add class on div using foreach if else Laravel
I have 5 items ( 3 items on first row & 2 items on 2nd row ) that loads something like this Here’s my sample blade code But what I’m trying to do is something like this By doing this I need to add a class named as ‘mid’ on this location Tried to use something like this But it
EACES permission denied when trying to launch an installed Symfony “Akeneo PIM” with Docker
I started my first internship on monday and I’m working on a PIM created by Akeneo, which is build using Symfony. They have a nice guide to install it on their website and I figured i’d learn docker too. Here are the instructions i followed so far : https://docs.akeneo.com/latest/install_pim/docke…
How can I use UserPasswordEncoderInterface without declaring it in function parameter
How can I use UserPasswordEncoderInterface without having to declare it as a function parameter? I would like to use this method somewhere else and because of that I can’t. Answer If you use autowire: true in your config you can inject the service. docs
How to join data table to select newest record in sql
I have two separate table LPG_usage and devices. In the LPG_usage table has 5 columns as (Device_id,Cylinder_Type,Date,Kg,Data_index ) and the devices table has 3 columns as (Device_id,User_name,Location) I want to select newest record by considering the Date in the LPG_usage table for all of Device_id’…
PHP cURL Received HTTP code 407 from proxy after CONNECT
I have a php curl with proxy problem. Below is my code: The format of proxies in proxy.txt is ip:port:user:pass and all proxies are working. The problem is when I used $proxyipport and $proxyuserpwd in CURLOPT_PROXY and CURLOPT_USERPWD, the curl result threw the error Received HTTP code 407 from proxy after C…