Notoriouswow Posted January 19, 2010 Share Posted January 19, 2010 For my new registration page, i have a SQL query needed to enter the user data into my database. Although i am unsure on how to generate the unique and specific entry ID needed. I think I would have to define how to get and create entry ID's in a different location and link back to that? I am unsure, if someone could help that would be great. Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/ Share on other sites More sharing options...
Catfish Posted January 19, 2010 Share Posted January 19, 2010 Dont know what you're asking about. Can you clarify a bit? Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-997937 Share on other sites More sharing options...
merylvingien Posted January 19, 2010 Share Posted January 19, 2010 Are you meaning so every user has a unique id number assigned to thier account? Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-997957 Share on other sites More sharing options...
Notoriouswow Posted January 20, 2010 Author Share Posted January 20, 2010 Yes, so when the database query's there account data, they each have there own unique ID. Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-998431 Share on other sites More sharing options...
trq Posted January 20, 2010 Share Posted January 20, 2010 See here Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-998432 Share on other sites More sharing options...
Notoriouswow Posted January 20, 2010 Author Share Posted January 20, 2010 Thank you, that seemed to have worked. But now I get the Unexpected T-STRING Error on line 33 Here's line 33: user_avatar_width,user_avatar_height, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ) VALUES ("mysql_insert_id()", 0, 3, '', 0,'".USER_IP."', 0, '".$user_info['user_name']."', '', '".$user_info['user_password']."', '', 0, '".$user_info['user_email']."', 0, 0, 0, 0, 'index.php', '', 0, 0 ,0, 0, 0, 0, 0, "en", "-6.0", 0, "D M d, Y g:i a", 13, 0, '', 0, 0, 0, 0, -3, 0, 0, "t", "d", 0, "t", "a", 0, 1, 0, 1, 1, 1, 1, 230271, '', 0, 64, 64, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0)"); It's just a continue of the code from like 32, would i need another character? like a ";"? Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-998517 Share on other sites More sharing options...
pneudralics Posted January 20, 2010 Share Posted January 20, 2010 Are you talking more about generating a unique id other than an autoincrement one? If so I usually do it in my registration. I'll add the email to the database so it'll get an autoincrement id. I then hash the email and add the autoincrement id to the end of my newly hash email to make sure no one will ever get the same unique id. I then just update my uniqueid field. Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-998527 Share on other sites More sharing options...
Notoriouswow Posted January 20, 2010 Author Share Posted January 20, 2010 Well I have the auto_increment working, i tested it on a different script. Now i just need help finding my parse error in my script. Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-998792 Share on other sites More sharing options...
wildteen88 Posted January 20, 2010 Share Posted January 20, 2010 You'll need to post more lines. Post lines 30 - 33 Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-998812 Share on other sites More sharing options...
Notoriouswow Posted January 20, 2010 Author Share Posted January 20, 2010 You'll need to post more lines. Post lines 30 - 33 Here's Line's 30 -33 As Requested: $result = dbquery("INSERT INTO ".$db_prefix."users (user_name, user_password, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_theme, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status) VALUES('".$user_info['user_name']."', '".$user_info['user_password']."', '".$user_info['user_email']."', '".$user_info['user_hide_email']."', '', '0000-00-00', '', '', '', '', '', 'Default', '0', '', '', '0', '".time()."', '0', '".USER_IP."', '', '', '101', '$activation')"); $result = dbquery("DELETE FROM ".$db_prefix."new_users WHERE user_code='$activate'"); //$result = dbquery("INSERT INTO ".website_forums."phpbb_users (user_id, user_type, group_id, user_permissions, user_perm_from, user_ip, user_regdate, username, username_clean, user_password, user_passchg, user_pass_convert, user_email, user_email_hash, user_birthday, user_lastvisit, user_lastmark, user_lastpost_time, user_lastpage, user_last_confirm_key, user_last_search, user_warnings, user_last_warning, user_login_attempts, user_inactive_reason, user_inactive_time, user_posts, user_lang, user_timezone, user_dst, user_dateformat, user_style, user_rank, user_colour, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_message_rules, user_full_folder, user_emailtime, user_topic_show_days, user_topic_sortby_type, user_topic_sortby_dir, user_post_show_days, user_post_sortby_type, user_post_sortby_dir, user_notify, user_notify_pm, user_notify_type, user_allow_pm, user_allow_viewonline, user_allow_viewemail, user_allow_massemail, user_options, user_avatar, user_avatar_type, //user_avatar_width,user_avatar_height, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ) VALUES ("mysql_insert_id()", 0, 3, '', 0,'".USER_IP."', 0, '".$user_info['user_name']."', '', '".$user_info['user_password']."', '', 0, '".$user_info['user_email']."', 0, 0, 0, 0, 'index.php', '', 0, 0 ,0, 0, 0, 0, 0, "en", "-6.0", 0, "D M d, Y g:i a", 13, 0, '', 0, 0, 0, 0, -3, 0, 0, "t", "d", 0, "t", "a", 0, 1, 0, 1, 1, 1, 1, 230271, '', 0, 64, 64, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0)"); I quoted out the lines that gave me errors so users could still register. Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-998818 Share on other sites More sharing options...
merylvingien Posted January 20, 2010 Share Posted January 20, 2010 Are you talking more about generating a unique id other than an autoincrement one? If so I usually do it in my registration. I'll add the email to the database so it'll get an autoincrement id. I then hash the email and add the autoincrement id to the end of my newly hash email to make sure no one will ever get the same unique id. I then just update my uniqueid field. I may be wrong in my thinking, so forgive me if i am. BUT if you have a auto increment field as an id, then every id will be unique NO? Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-998824 Share on other sites More sharing options...
wildteen88 Posted January 20, 2010 Share Posted January 20, 2010 Change those four lines to $result = dbquery("INSERT INTO ".$db_prefix."users (user_name, user_password, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_theme, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status) VALUES('".$user_info['user_name']."', '".$user_info['user_password']."', '".$user_info['user_email']."', '".$user_info['user_hide_email']."', '', '0000-00-00', '', '', '', '', '', 'Default', '0', '', '', '0', '".time()."', '0', '".USER_IP."', '', '', '101', '$activation')"); $result = dbquery("DELETE FROM ".$db_prefix."new_users WHERE user_code='$activate'"); $result = dbquery("INSERT INTO ".website_forums."phpbb_users (user_id, user_type, group_id, user_permissions, user_perm_from, user_ip, user_regdate, username, username_clean, user_password, user_passchg, user_pass_convert, user_email, user_email_hash, user_birthday, user_lastvisit, user_lastmark, user_lastpost_time, user_lastpage, user_last_confirm_key, user_last_search, user_warnings, user_last_warning, user_login_attempts, user_inactive_reason, user_inactive_time, user_posts, user_lang, user_timezone, user_dst, user_dateformat, user_style, user_rank, user_colour, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_message_rules, user_full_folder, user_emailtime, user_topic_show_days, user_topic_sortby_type, user_topic_sortby_dir, user_post_show_days, user_post_sortby_type, user_post_sortby_dir, user_notify, user_notify_pm, user_notify_type, user_allow_pm, user_allow_viewonline, user_allow_viewemail, user_allow_massemail, user_options, user_avatar, user_avatar_type, user_avatar_width,user_avatar_height, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ) VALUES (".mysql_insert_id().", 0, 3, '', 0,'".USER_IP."', 0, '".$user_info['user_name']."', '', '".$user_info['user_password']."', '', 0, '".$user_info['user_email']."', 0, 0, 0, 0, 'index.php', '', 0, 0 ,0, 0, 0, 0, 0, 'en', '-6.0', 0, 'D M d, Y g:i a', 13, 0, '', 0, 0, 0, 0, -3, 0, 0, 't', 'd', 0, 't', 'a', 0, 1, 0, 1, 1, 1, 1, 230271, '', 0, 64, 64, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0)"); Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-998827 Share on other sites More sharing options...
Notoriouswow Posted January 21, 2010 Author Share Posted January 21, 2010 Change those four lines to $result = dbquery("INSERT INTO ".$db_prefix."users (user_name, user_password, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_theme, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status) VALUES('".$user_info['user_name']."', '".$user_info['user_password']."', '".$user_info['user_email']."', '".$user_info['user_hide_email']."', '', '0000-00-00', '', '', '', '', '', 'Default', '0', '', '', '0', '".time()."', '0', '".USER_IP."', '', '', '101', '$activation')"); $result = dbquery("DELETE FROM ".$db_prefix."new_users WHERE user_code='$activate'"); $result = dbquery("INSERT INTO ".website_forums."phpbb_users (user_id, user_type, group_id, user_permissions, user_perm_from, user_ip, user_regdate, username, username_clean, user_password, user_passchg, user_pass_convert, user_email, user_email_hash, user_birthday, user_lastvisit, user_lastmark, user_lastpost_time, user_lastpage, user_last_confirm_key, user_last_search, user_warnings, user_last_warning, user_login_attempts, user_inactive_reason, user_inactive_time, user_posts, user_lang, user_timezone, user_dst, user_dateformat, user_style, user_rank, user_colour, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_message_rules, user_full_folder, user_emailtime, user_topic_show_days, user_topic_sortby_type, user_topic_sortby_dir, user_post_show_days, user_post_sortby_type, user_post_sortby_dir, user_notify, user_notify_pm, user_notify_type, user_allow_pm, user_allow_viewonline, user_allow_viewemail, user_allow_massemail, user_options, user_avatar, user_avatar_type, user_avatar_width,user_avatar_height, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ) VALUES (".mysql_insert_id().", 0, 3, '', 0,'".USER_IP."', 0, '".$user_info['user_name']."', '', '".$user_info['user_password']."', '', 0, '".$user_info['user_email']."', 0, 0, 0, 0, 'index.php', '', 0, 0 ,0, 0, 0, 0, 0, 'en', '-6.0', 0, 'D M d, Y g:i a', 13, 0, '', 0, 0, 0, 0, -3, 0, 0, 't', 'd', 0, 't', 'a', 0, 1, 0, 1, 1, 1, 1, 230271, '', 0, 64, 64, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0)"); Thank you very much, i no longer get any errors, although it doesn't complete the MYSQL query, there's nothing in the table. Is it because phpbb encrypts the password? Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-999156 Share on other sites More sharing options...
Notoriouswow Posted January 21, 2010 Author Share Posted January 21, 2010 Change those four lines to $result = dbquery("INSERT INTO ".$db_prefix."users (user_name, user_password, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_theme, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status) VALUES('".$user_info['user_name']."', '".$user_info['user_password']."', '".$user_info['user_email']."', '".$user_info['user_hide_email']."', '', '0000-00-00', '', '', '', '', '', 'Default', '0', '', '', '0', '".time()."', '0', '".USER_IP."', '', '', '101', '$activation')"); $result = dbquery("DELETE FROM ".$db_prefix."new_users WHERE user_code='$activate'"); $result = dbquery("INSERT INTO ".website_forums."phpbb_users (user_id, user_type, group_id, user_permissions, user_perm_from, user_ip, user_regdate, username, username_clean, user_password, user_passchg, user_pass_convert, user_email, user_email_hash, user_birthday, user_lastvisit, user_lastmark, user_lastpost_time, user_lastpage, user_last_confirm_key, user_last_search, user_warnings, user_last_warning, user_login_attempts, user_inactive_reason, user_inactive_time, user_posts, user_lang, user_timezone, user_dst, user_dateformat, user_style, user_rank, user_colour, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_message_rules, user_full_folder, user_emailtime, user_topic_show_days, user_topic_sortby_type, user_topic_sortby_dir, user_post_show_days, user_post_sortby_type, user_post_sortby_dir, user_notify, user_notify_pm, user_notify_type, user_allow_pm, user_allow_viewonline, user_allow_viewemail, user_allow_massemail, user_options, user_avatar, user_avatar_type, user_avatar_width,user_avatar_height, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ) VALUES (".mysql_insert_id().", 0, 3, '', 0,'".USER_IP."', 0, '".$user_info['user_name']."', '', '".$user_info['user_password']."', '', 0, '".$user_info['user_email']."', 0, 0, 0, 0, 'index.php', '', 0, 0 ,0, 0, 0, 0, 0, 'en', '-6.0', 0, 'D M d, Y g:i a', 13, 0, '', 0, 0, 0, 0, -3, 0, 0, 't', 'd', 0, 't', 'a', 0, 1, 0, 1, 1, 1, 1, 230271, '', 0, 64, 64, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0)"); In theory, it should but it doesn't work out to well most of the time. Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-999216 Share on other sites More sharing options...
Notoriouswow Posted January 21, 2010 Author Share Posted January 21, 2010 --Bump-- Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-999456 Share on other sites More sharing options...
Notoriouswow Posted January 21, 2010 Author Share Posted January 21, 2010 Please help --Bump-- Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-999547 Share on other sites More sharing options...
Minase Posted January 21, 2010 Share Posted January 21, 2010 hmm ok replace that line with this $result = dbquery("INSERT INTO ".website_forums."phpbb_users (user_id, user_type, group_id, user_permissions, user_perm_from, user_ip, user_regdate, username, username_clean, user_password, user_passchg, user_pass_convert, user_email, user_email_hash, user_birthday, user_lastvisit, user_lastmark, user_lastpost_time, user_lastpage, user_last_confirm_key, user_last_search, user_warnings, user_last_warning, user_login_attempts, user_inactive_reason, user_inactive_time, user_posts, user_lang, user_timezone, user_dst, user_dateformat, user_style, user_rank, user_colour, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_message_rules, user_full_folder, user_emailtime, user_topic_show_days, user_topic_sortby_type, user_topic_sortby_dir, user_post_show_days, user_post_sortby_type, user_post_sortby_dir, user_notify, user_notify_pm, user_notify_type, user_allow_pm, user_allow_viewonline, user_allow_viewemail, user_allow_massemail, user_options, user_avatar, user_avatar_type,user_avatar_width,user_avatar_height, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ) VALUES ("mysql_insert_id()", 0, 3, '', 0,'".USER_IP."', 0, '".$user_info['user_name']."', '', '".$user_info['user_password']."', '', 0, '".$user_info['user_email']."', 0, 0, 0, 0, 'index.php', '', 0, 0 ,0, 0, 0, 0, 0, 'en', '-6.0', 0, 'D M d, Y g:i a', 13, 0, '', 0, 0, 0, 0, -3, 0, 0, 't', 'd', 0, 't', 'a', 0, 1, 0, 1, 1, 1, 1, 230271, '', 0, 64, 64, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0)"); it should work and btw you have stored user ip in a constant USER_IP ?? or is that just an undefined value?? Quote Link to comment https://forums.phpfreaks.com/topic/189013-generate-unique-entry-id/#findComment-999557 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.