I have added new text field in registration form using hook_user. but i could not insert into the database.
How to do that, where should i write insert query. I used following code.

function beep_user($op, &$edit, &$account, $category = NULL) {
if ($op == 'register' && $category == 'submit') {
// do stuff...

// using an explicit INSERT statement:
db_query("INSERT INTO {user_ip} (uid, ip) VALUES (2,'111.111.111')");

// using drupal_write_record():
drupal_write_record('users_ip');

// And this code
db_insert('user_ip')->fields(array('uid' => 2, 'ip' => '111.111.111'))->execute();

// And this
$sql = "INSERT INTO {users_ip} (uid,ip) VALUES (2,'".$_SERVER['REMOTE_ADDR']."')";
db_query($sql);

}
}

but still it's not working.
somebody help me please.

Comments

jacob.embree’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

This question does not appear to have anything to do with Dirty Forms.