I've been trying for hours to retrieve an ID from a previous insert statement to include in the next insert statement. I am not sure what I am doing on but a new fresh set of eyes can see the issue better than I can at the moment. Any help is greatly appreciated:
//run the query which adds the data gathered from the form into the database
$result = $chmdb->query("INSERT INTO " . DB . "members (user_id,username, first_name, last_name, email, address1, address2, city, state, zip,
phone, member, password, active) VALUES ('NULL','$username','$first_name','$last_name','$email','$address1','$address2','$city','$state',
'$zip','$phone','$member','$password','1')");
$uID = $chmdb->query("SELECT LAST_INSERT_ID() FROM " . DB . "members");
$chmdb->query("INSERT INTO " . DB . "user_roles (userID,roleID,addDate) VALUES ('$chmdb->uID','$roleID',NOW())");