Skip to main content
Discouraged usage of this answer.
Source Link
user20301
  • 514
  • 2
  • 7

As stated by @Molot this should not be used generally. Recommended methods would be db_insert and db_merge.

Placeholders are layed wrong, they need to be in single array. Use

 $sql = "INSERT INTO {customers} (first_name,last_name,email_addr,password)
         VALUES(:fName, :lName, :email , :cpwd)";
db_query($sql,
    array(
      ':fName' => $form_state['values']['fName'],
      ':lName' => $form_state['values']['lName'],
      ':email' => $form_state['values']['email'],
      ':cpwd' => $form_state['values']['cpwd'],
   ),
);

Placeholders are layed wrong, they need to be in single array. Use

 $sql = "INSERT INTO {customers} (first_name,last_name,email_addr,password)
         VALUES(:fName, :lName, :email , :cpwd)";
db_query($sql,
    array(
      ':fName' => $form_state['values']['fName'],
      ':lName' => $form_state['values']['lName'],
      ':email' => $form_state['values']['email'],
      ':cpwd' => $form_state['values']['cpwd'],
   ),
);

As stated by @Molot this should not be used generally. Recommended methods would be db_insert and db_merge.

Placeholders are layed wrong, they need to be in single array. Use

 $sql = "INSERT INTO {customers} (first_name,last_name,email_addr,password)
         VALUES(:fName, :lName, :email , :cpwd)";
db_query($sql,
    array(
      ':fName' => $form_state['values']['fName'],
      ':lName' => $form_state['values']['lName'],
      ':email' => $form_state['values']['email'],
      ':cpwd' => $form_state['values']['cpwd'],
   )
);
Unquoted the placeholders.
Source Link
user20301
  • 514
  • 2
  • 7

Placeholders are layed wrong, they need to be in single array. Use

 $sql = "INSERT INTO {customers} (first_name,last_name,email_addr,password)
         VALUES(':fName'fName, ':lName'lName, ':email'email , ':cpwd'cpwd)";
db_query($sql,
    array(
      ':fName' => $form_state['values']['fName'],
      ':lName' => $form_state['values']['lName'],
      ':email' => $form_state['values']['email'],
      ':cpwd' => $form_state['values']['cpwd'],
   ),
);

Placeholders are layed wrong, they need to be in single array. Use

 $sql = "INSERT INTO {customers} (first_name,last_name,email_addr,password)
         VALUES(':fName', ':lName', ':email' , ':cpwd')";
db_query($sql,
    array(
      ':fName' => $form_state['values']['fName'],
      ':lName' => $form_state['values']['lName'],
      ':email' => $form_state['values']['email'],
      ':cpwd' => $form_state['values']['cpwd'],
   ),
);

Placeholders are layed wrong, they need to be in single array. Use

 $sql = "INSERT INTO {customers} (first_name,last_name,email_addr,password)
         VALUES(:fName, :lName, :email , :cpwd)";
db_query($sql,
    array(
      ':fName' => $form_state['values']['fName'],
      ':lName' => $form_state['values']['lName'],
      ':email' => $form_state['values']['email'],
      ':cpwd' => $form_state['values']['cpwd'],
   ),
);
Source Link
user20301
  • 514
  • 2
  • 7

Placeholders are layed wrong, they need to be in single array. Use

 $sql = "INSERT INTO {customers} (first_name,last_name,email_addr,password)
         VALUES(':fName', ':lName', ':email' , ':cpwd')";
db_query($sql,
    array(
      ':fName' => $form_state['values']['fName'],
      ':lName' => $form_state['values']['lName'],
      ':email' => $form_state['values']['email'],
      ':cpwd' => $form_state['values']['cpwd'],
   ),
);