I'm running Drupal 7 site on WAMP Server!
I'm using below code in a custom block to get data from the database :
$result = db_select('event', 'x')
->fields('x', array('address'))
->execute()
->fetchAll();
foreach ($result as $value) {
print_r ($value);
}
Event is the name of node we use
Every time I try to reload the page, I get this message :
The website encountered an unexpected error. Please try again later.
When I check WAMP PHP error log, there is nothing in it about it !
Any idea ?
Update : Now is see I get this error :
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.event' doesn't exist: SELECT x.address AS address FROM {event} x; Array ( ) in eval()
I understand that it mean it can't find the table, but why ? I found it like that in every example on the internet !