I’m doing a easy insert question utilizing the db_insert name; regardless of the place I do that, I get the identical outcome. Is that this an error with the Drupal 7 DAL, or am I doing one thing flawed?
The script isn’t working a number of instances, nor Does the question run a number of instances; I’m utilizing the next in a customized PHP file to generate the info.
chdir('../'); outline('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT . '/contains/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); $question = db_insert("table_name") ->fields(array('nid' => 10, 'width' => 200, 'peak' => 800)) ->execute();
I need to insert one file with the next knowledge.
- nid: 10
- width: 200
- peak: 800
Operating this all the time leads to 2 precise data within the database, with out errors. May or not it’s something to do with not at present having the desk I’m inserting into inside my modules .set up file? Possibly Drupal is doing one thing daft as a result of it may well’t discover the database schema information?