Mega Code Archive

 
Categories / MySQL / Function
 

Each time a conference registration form is received, enter the attendee information into the attendee table

For example: mysql> mysql> CREATE TABLE attendee(     ->     att_id      INT UNSIGNED NOT NULL AUTO_INCREMENT,     ->     att_name    CHAR(100),     ->     att_title   CHAR(40),     ->     PRIMARY KEY (att_id)     -> ); Query OK, 0 rows affected (0.00 sec) mysql> mysql> INSERT INTO attendee (att_name,att_title) VALUES('Charles Loviness','IT Manager'); Query OK, 1 row affected (0.00 sec) mysql> mysql> SELECT * FROM attendee WHERE att_id = LAST_INSERT_ID(); +--------+------------------+------------+ | att_id | att_name         | att_title  | +--------+------------------+------------+ |      1 | Charles Loviness | IT Manager | +--------+------------------+------------+ 1 row in set (0.00 sec) mysql> mysql> drop table attendee; Query OK, 0 rows affected (0.00 sec)