2
Not much to talk about. What I need is to know how to make a query that returns me an object instead of an array in the format:
$eventos = [
new Evento(1, new \DateTime('2015-01-26'), 'Titulo #1'),
new Evento(2, new \DateTime('2015-01-31'), 'Titulo #2'),
new Evento(3, new \DateTime('2015-03-02'), 'Titulo #3'),
new Evento(4, new \DateTime('2015-05-04'), 'Titulo #4'),
new Evento(5, new \DateTime('2015-05-08'), 'Titulo #5'),
new Evento(6, new \DateTime('2015-08-01'), 'Titulo #6'),
new Evento(7, new \DateTime('2015-09-14'), 'Titulo #7'),
new Evento(8, new \DateTime('2015-09-19'), 'Titulo #8'),
new Evento(9, new \DateTime('2015-11-10'), 'Titulo #9')
];
What is the API for connection to the database?
– rray
you’ve seen this link, with the
fetch_fields
returns the object...– h3nr1ke
I’ll use PDO @rray
– Marcos Vinicius
PDO::FETCH_OBJ
in thefetch()
orfetchAll()
Solve it? You can do it another way– rray