Hello,
I’m new in Drupal (few days). I developed a simple module just to understand how drupal works.
It’s a simple form. User give first name, last name and email, then the module insert into the “inscription” table.
Everything works well.
But,I tried some test about integrity of the data base. So I just modify the table “insert” to see how drupal will work with a bad sql query. I change e_mail in email. Just for test.
function inscription_insert($node) {
db_query("INSERT INTO {inscription} (vid, nid, nom, prenom, e_mail ) VALUES (%d, %d, '%s', '%s','%s' )", $node->vid, $node->nid, $node->nom, $node->prenom, $node->email);
}
I got 2 problems.
1.- “drupal” give 2 messages. The first is ok error sql (is not a warning… neverless), but the second message is incorrect the “Inscription hasn’t been created.
Drupal message
--------------------------------------------------------------------------------------------------------------------
• user warning: Unknown column 'e_mail' in 'field list' query: INSERT INTO inscription (vid, nid, nom, prenom, e_mail ) VALUES (3, 3, 'bla', 'bla','bla' ) in D:\xampplite\htdocs\drupal\sites\all\modules\inscription\inscription.module on line 142.