0

I have drupal setup on my local machine (Aquia dev desktop). I created a table in my database called "pin_code". I want to write a php script that would involve connecting to the database. I have used the values from my settings.php file. Unfortunately i get the error "No connection could be made because the target machine actively refused it."

Please what could i be doing wrong?

  • It may be easiest to just bootstrap Drupal with your external script, and use Drupal's API functionality/db connection to talk to the database. See, for example: avenuewebmedia.com/… – geerlingguy Sep 16 '13 at 0:08
  • You can run the script separately using Drush's php-script ... – AgA Sep 16 '13 at 4:12
  • @geerlingguy, thanks. However this is the message i get after copying and pasting the code from the link you mentioned. code Warning: chdir() [function.chdir]: No such file or directory (errno 2) in C:\Users\SEYI\Desktop\obs\test.php on line 6 Notice: Use of undefined constant DRUPAL_ROOT - assumed 'DRUPAL_ROOT' in C:\Users\SEYI\Desktop\obs\includes\bootstrap.inc on line 2270 Warning: require_once(DRUPAL_ROOT/includes/errors.inc) [function.require-once]: failed to open stream: No such file or directory in code – seyi Sep 16 '13 at 6:56
  • code C:\Users\SEYI\Desktop\obs\includes\bootstrap.inc on line 2270 Fatal error: require_once() [function.require]: Failed opening required 'DRUPAL_ROOT/includes/errors.inc' (include_path='.;C:\Program Files\acquia-drupal\common\pear') in C:\Users\SEYI\Desktop\obs\includes\bootstrap.inc on line 2270 code Do i need to edit the code? – seyi Sep 16 '13 at 6:59
  • @AgA, thanks, but I have little knowledge of Drush. – seyi Sep 16 '13 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.