Not sure where I'm screwing up here. I'll post the database schema if it's not obvious, for some reason the fourth query returns false though.
Code:
$query = "INSERT INTO jos_users
(name, usertype, username, email, password, registerDate, gid, sendEmail, block, params, lastvisitDate)
VALUES
('".$name."', 'Registered', '".$username."', '".$email."', '".$password."', '".$date."', '18', '0', '0', '".$params."', '".$date."')";
$query2 = "INSERT INTO jos_core_acl_aro (id, section_value, value, order_value, name, hidden)
VALUES (NULL, 'users', LAST_INSERT_ID(), '0', '".$name."', '0')";
$query3 = "INSERT INTO jos_core_acl_groups_aro_map VALUES (18, '', LAST_INSERT_ID())";
$query4 = "INSERT INTO jos_comprofiler
(id, user_id, firstname, lastname, hits, message_last_sent, message_number_sent, avatar, avatarapproved, approved, confirmed, lastupdate, registeripaddr, banned)
VALUES (NULL, LAST_INSERT_ID(), '".$fname."', '".$lname."', '0', '0000-00-00 00:00:00', '0', NULL, '1', '1', '1', '0000-00-00 00:00:00', '".$ip_addr."', '0')";
$query = mysql_query($query);
$query2 = mysql_query($query2);
$query3 = mysql_query($query3);
$query4 = mysql_query($query4);
keep in mind that I'm leaving quite a few values out, that shouldn't matter though since I'm specifying which columns to add the data to correct?