How to improve the speed of a for loop in PHP?

I have a CSV file with different lines: ;0;1;0;4;5;M;468468;A1101;0090 0;1;0;4;5;M;468468;A1108;0090 And in a folder of photos that must have the naming format “A1101_0090-1.JPG” for the …

Display Average Rating by Id with Count of Ids Mysql

I have an MYSQL table, where I want to get the average rating with a count of product id. Here is the sample of the table. ╔════╦═════════════╦══════════╦══════════╗ ║ ID ║ product_Id ║ rating ║ …

Doctrine 2: Load entity and childs count

I have these two entities: Message entity class Message { /** * @ManyToOne(targetEntity=”User”) * @JoinColumn(name=”author”, referencedColumnName=”id_user”) */ protected $author; …