0

Running into an issue here caused by something beyond my control. I am running a DB query on a table I did not create, it has a table column named "end". This is screwing up my foreach loop as it only gets the first instance and then stops on that particular variable.

Here is my current code:

$eventDates = array();
  foreach( $events as $event ) :
    $eventDates[ $event->post_id ] = $event->start; 
    $eventEnd[ $event->post_id ] = $event->end; 
    $eventVenue[ $event->post_id ] = $event->venue;     
endforeach;

The $event->end; is the problem. Is there another way I can output that data that won't cause a conflict?

RiotAct
  • 743
  • 9
  • 33

1 Answers1

2

Try aliasing the column name in the request otherwise.

select end as thisIsTheEnd ...

St3an
  • 726
  • 1
  • 6
  • 21