Skip to content

Tag: php

Get mysql table field names in ZF2

I want to store the csv data dynamically into mysql table. According to my csv columns header i want to insert the data into respective columns in mysql table. For this, I need to get all the table fields name from Zend Framework Controller or Model. I have tried with: ** ** But, it shows the error: Fatal err…

Mysql timestamps and php date()

The mysql timestamp is in a standard format 2013-02-20 02:25:21, when I use date(‘H:i:s’,$date) I get the same invalid output 18:33:33, how can I get the right output? hour:minute:seconds Answer Tip : try with MYSQL DATE_FORMAT function if you want to do it only with PHP then use strtotime

Summing over multiple fields in Laravel

I’m wondering if it is possible to take the sum of multiple fields in one query using the fluent query builder. I currently have two tables: events and attendees. Attendees belong to events and have two fields: total_raised and total_hours. What I want to do is select all events and the total amount rai…

use font in mPDF generated document

I would like you to help me with this issue, I’m dealing for the first time with mPDF which I think it’s great, but I want to display the report with the same type of font as my web, which on its documentations explains how to achieve this, but it doesn’t still seems to work for me. What I d…