D
D
Dmitry Kamyannoy2016-01-04 10:23:33
Drupal
Dmitry Kamyannoy, 2016-01-04 10:23:33

How to remove the prefix of the connected table through db_select?

Good morning gurus!
Actually a question.

$query = db_select('user_discounts', 'u'); 
  $query->fields('user_discounts', array('CardNum'));
  $result = $query->execute();

As a result I get
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table namedatabase.prefix_user_discounts ' doesn't exist

For all that, the plate is custom and there is no prefix in it. But the system automatically tries to add it and of course I can’t connect to it.
P.S. in settings.php did not register the default prefix.
Thank you very much =)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tlito, 2016-01-04
@tlito

if this is not a Drupal table, then the function must be used not Drupal
IMHO

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question