I am having problem fetching data by using doctrine with native sql, below code works fine on my local development machine but when I test it online. I get
Oops! An Error Occurred The server returned a "500 Internal Server Error". Something is broken. Please e-mail us at [email] and let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
Here is my query in controller:-
$em = $this->getDoctrine()->getManager();
$connection = $em->getConnection();
$statement = $connection->prepare("SELECT * FROM students");
$statement->execute( );
$results = $statement->fetchAll();
return $this->render('MobileLearnerBundle:Default:test_page.html.twig', array('results'=>$results));
test_page.html.twig code:-
{% for item in results %}
{{ item.first_name }}
{{ item.last_name }}
{% endfor %}
Thanks for the help in advance !
database_hostto localhost? - qooplmao