Skip to content

data-id always returns the same value

I am calling an api using ajax which returns me a list of available coaches in a particular area. I am then displaying each coach and his details(firstname, picture, email etc) in a div using foreach …

PHP Add days to datetime based on form selection

I am trying to insert a datetime into my MySQL DB that adds a certain amount of time depending on what is selected from the form. For example, clicking the button on 2021-04-01 22:00:00 and selecting &…

Eager loading via QueryBuilder leftJoin

When I wrote: $query = $this->employeeRepository->createQueryBuilder(‘e’) ->leftJoin(‘e.department’, ‘d’) ; return $query->getQuery()->getResult(); I expected to get the related …

String and number in for each

I have this code: Expected result (to put as text in another PHP file): $Avroeger = 8.8; $Bvroeger = 5.5; Actual result: (where the 8.3 and 5.7 are the old values of $Avroeger and $Bvroeger) 8.3 = 8.8; 5.7 = 5.5; Anyone who can help? Thank you in advance! Answer You are doing the appending wrong. Do it as sho…

How to save data into cookie in PHP from PDO

I need some help as have been stuck here for a while, please bear with me as am a rookie and perhaps this might be simple to a seasoned developer, basically am trying to save data into a cookie so that i only hit the database once, after that, I want when i reload the page to get my data

Generated variable results in wrong result

I have the following code: $fut1 = 9814; $Awaarde = 8304; $Bwaarde = 5111; $arrayAantallen = array(“A”, “B”); foreach ($arrayAantallen as $letter) { $lijstMijnWaardes .= ‘…

New lines HTML if value changed in MySql Output via PHP

This is the HTML/PHP , I am using to display some data. and I am getting the data like this from the db. This outputs a single table with all the data. My question is , is there a way to break the single table into tables when the value of postid changes? It goes like..is 1 for x number