function patron_insert in Library 6
Same name and namespace in other branches
- 5.2 patron/patron.module \patron_insert()
Implemenation of hook_insert().
File
- patron/
patron.module, line 121
Code
function patron_insert($node) {
if (empty($node->patron_uid)) {
db_query("INSERT INTO {library_patrons} (nid, name_last, name_first, email, patron_uid, barcode, disabled) VALUES (%d, '%s', '%s', '%s', NULL, '%s', %d)", $node->nid, $node->name_last, $node->name_first, $node->email, $node->barcode, $node->disabled);
}
else {
db_query("INSERT INTO {library_patrons} (nid, name_last, name_first, email, patron_uid, barcode, disabled) VALUES (%d, '%s', '%s', '%s', %d, '%s', %d)", $node->nid, $node->name_last, $node->name_first, $node->email, $node->patron_uid, $node->barcode, $node->disabled);
}
}