Skip to content

Tag: php

logged user does not have all fields filled up

I’m using Symfony 2.8 and Doctrine and I have security.yml configured to point to the User class which implements UserInterface. My ORM schema is in YAML. The problem: In database the user has also specified “email” field, Symfony for LOGGED USER is not filling up that field and also “…

determine actions over period of time PHP MySQL

I don’t have any code or database to display, because I am in the planning stage, and I can’t figure out the correct way to do this. I want to determine if a user has performed a specific action each day over the course of a week. If they have I want to perform an action. Each time there is

PDO FetcthAll to JSON null

I’m creating a APIRest in Angular and I need to parse PHP results to JSON. I read some answer about this problem, but didn’t resolve my problem. The problem is the json_encode return null, and i don’t know why. Answer For JSON you need utf-8 encoded data, thus you have to tell PDO that the r…

Update database with db2

I need some help with convert these MySQL line to Db2, I’m not sure which one to use. Lines I need convert are mysql_select_db(‘P510F’); And is it right to add p510f in there? Or is it meant for something else to be there? break Answer Could you try something like this;

Using DateTime as a one-liner in PHP

A short and simple question which I couldn’t really find an answer for. In procedural PHP I could echo a date In Object oriented PHP I have to use two lines Is it possible to do this in one line? Answer There are two options: Create a DateTime instance using parenthesis and format the result: You can us…