Fork me on GitHub

Need PHP code Help for a database.  Bottom

  • I am trying to modify the script to work with the pnphpbb forums. However, everything else so far works, except the deleting of the people in the groups first.
    I do not know SQL code and wish for anyone to help. This is for WOWroster to synch with pnphphbb.. I will repost the index.php file and instructions for people who would like it afterwards.

    Thanks in advance.

    Code

    echo 'Removing all members...<br>';
            // now check for users
            $sql = "DELETE FROM " . $table_prefix . "user_group WHERE group_id = ".$phpbb_defaultGroup;
           
            if ($roster_conf['sqldebug']) {
                echo "\n<!-- $sql -->\n";
            }
            $result = $db_phpbb->sql_query($sql) or die(mysql_error())


            // Now remove all the custom groups
            foreach( $phpbb_rankGroupMappings as $key => $value){
                $sql = "DELETE FROM " . $table_prefix . "user_group WHERE group_id = ".$value;
                $result_char = $wowdb->query($sql);
            }
  • even when I hard code it, it wont allow that to be deleted

    Code

    $sql = 'DELETE FROM `_phpbb_user_group` WHERE group_id =354';
    $sql = 'DELETE FROM `_phpbb_user_group` WHERE group_id =355';
    $sql = 'DELETE FROM `_phpbb_user_group` WHERE group_id =356';




    edited by: silverscout, Jun 08, 2007 - 01:48 PM
  • I am not a mysql / PHP wiz by any means, but perhaps I can help.

    What errors are you getting (you may have to turn off the error suppressing in PN - a search here should show you how to display errors)?

    Try this:

    Code

    $sql = "DELETE FROM `_phpbb_user_group` WHERE group_id =354";

    (double quotes - not sure if it will make a huge difference)
  • This is in another app, not a postnuke module but one for wowroster, it was originally done for phpbb to synch the users in the roster with the right group and rank on the forums. The ranks are working fine, the moving the users is working fine. However, it wont empty out those 3 groups first. "which it should do to update the information the easiest way"

    I have
    MySQL Version 4.1.14
    PHP Version 5.2.2

    I posted here because of the brains and I trust you guys better. :) also, I am trying to modify a pnphpbb database lol.

  • I see what I did wrong.

    The code needed both tables to be in one database, I thought it was, I guess I uploaded the test Config file for the roster by mistake one day and have been using the test database. lol

    Once I changed the config the code worked fine.
  • in order to get the phpbb synch for wow roster to work.
    I took a Config.php from a phpbb install and configured it and put it in the pnphpbb directory.

    then in the conf.php for the synch program for wowroster, I edited the code to point to ../modules/pnphpbb

    This fixed all issues and everything seems to work now.

  • 0 users

This list is based on users active over the last 60 minutes.