Hello all...I have a form, where after its filled out it adds the data to a table. The table has a primary unique key, so every time someone fills out the form, that value is updated. My problem is, I want to be able to return what key was given when I use the INSERT command. So when someone fills out the form, I want to be able to tell them their member number. I read something about the LAST_INSERT_ID() function but I'm lost as to how to use it. Here's the code I'm using:
db_connect() or (print "could not connect...");
$query = "Insert into members(
last_name, first_name, email, street1, city_st_zip, country, phone, referer, password, gender, marrital_status, b_month, b_day, b_year, interests, signup_date)
values('$lname', '$fname', '$email', '$street1', '$citystzip', '$country', '$phone', '$ref', '$password', '$gender', '$marrital_status', '$bmonth', '$bday', '$byear', '$da_interests', '$da_date')";
mysql_query($query, $link);
where db_connect() is a pre-defined function I created that connects to the database. The primary key is named member_id and I want to be able to tell the user what key they were given. Can someone help me out? Thanks!