Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7445181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:45:34+00:00 2026-05-29T11:45:34+00:00

I am building a custom ,module with a custom content type. I have defined

  • 0

I am building a custom ,module with a custom content type. I have defined the content type and created my form.

The “Title” is being put into the {node} table with the respective nid, however I need to enter the rest of my data into my custom table.

Its just not working 🙁

I am using hook_insert

This is the function

function svm_mail_insert($node) {
db_query("INSERT INTO {svm_mail_esp_acc} (vid, nid, api_name, esp_id, api_key) VALUES (%d, %d, '%s', %d, %s)", $node->vid, $node->nid, $node->account, $node->esp_refferer, $node->api_key);
}

Any Ideas what Im doing wrong and also how can I see the $node array after the form has been processed, but before the data is entered into the db to ensure that the $node is actually being populated?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:45:34+00:00Added an answer on May 29, 2026 at 11:45 am

    Sorry to sound like a parser but…You have an error in your SQL syntax!

    You’re putting a string value into the query without putting quotes around it…MySQL will have a fit with that. It’s the last value, for the api_key column, that’s missing the quotes:

    function svm_mail_insert($node) {
      db_query("INSERT INTO {svm_mail_esp_acc} (vid, nid, api_name, esp_id, api_key) VALUES (%d, %d, '%s', %d, '%s')", $node->vid, $node->nid, $node->account, $node->esp_refferer, $node->api_key);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a Job Queue module that processes jobs and constructs social-network type
I have created a custom module and am using hook_block to programmatically create some
I am building a custom module in Drupal 7. I have a URL which
I'm working on building a custom module in Orchard CMS, and I have the
I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately,
I'm building a custom Ubuntu kernel and have modified one of the source files.
I am building a custom Content Management System for my client, using C#2008, ASP.Net
I'm building a custom component that extends SkinnableContainer. I can center the content either
I'm building a custom module and I need to be able to add an
I'm building custom content filtering system using custom radio buttons. There are some problems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.