You can use user_delete which besides deleting the user, also fires off the user hook with the delete op, so any other modules that are listening will clean up whatever they need to clean up.  The implementation of hook_user in the node module will set the uid of existing nodes to 0 in this case, but not delete them.  So if you want to eliminate all the nodes for the users, you would want to do that first (node_delete) before doing the user_delete.<br>
<br>You&#39;d wrap this all up in a while loop that iterated over each existing uid.<br><br><div class="gmail_quote">On Thu, Mar 12, 2009 at 2:46 PM, Steve Power <span dir="ltr">&lt;<a href="mailto:steev@initsix.co.uk">steev@initsix.co.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi<br><br>ive been migrating a customer from phpbb2 to D6.  Was sposed to go live on sunday...  Ive had numerous issues (mainly due to poor sql performance on ec2 instances!) and the rest is due to be finished tonight starting 10pm uk time....one problem is that the customer has been using the test site to create nodes, while i stupidly had test forum data on there.  I have managed to delete all the test forum data, but im left with 1700 users who need to be readded from the most recent cut of the phpbb database.<br>

<br>Anyways, longer story shorter - does anyone know the SQL i can use to delete all authetnicated users, all their post settings (e.g. user_titles_posts) and related tables etc?  I assume there is a drupal function that i can loop through somewhere, but im running out of time and wondered if anyone had done this before, and if they could point me in the right direction! <br>

<br>cheers!<br clear="all"><br>-- <br>-- <br>--<br>Steve Power<br>Principal Consultant<br>Mobile: +44 (0) 7747 027 243<br>Initsix Technology and Media<br><font color="#888888">--<br>&quot;So Linux is bulletproof? No. Bulletproof is one of the last stages of drunkenness, not a state of security&quot;  <a href="http://www.linux.com/feature/60208" target="_blank">http://www.linux.com/feature/60208</a><br>


</font><br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br>