Delete Null Clan

Results 1 to 19 of 19
  1. #1
    Proficient Member Lolled is offline
    MemberRank
    Jan 2010 Join Date
    185Posts

    Delete Null Clan

    Hello guy,
    I have this script by Wizkid
    PHP Code:
    <?php
    //Written by Wizkid
    //Copyright 2008 - 2009

    //Let us connect the databases.
    //Yeah yeah, ODBC this time.
    $host "HOST\SQLEXPRESS"//The host.
    $user "sa"//The username.
    $pass "*****"//The password. I hope it's unique for you.
    $dbname "NameDB"//The dbname. Most likely GunzDB.

    $connect odbc_connect("Driver={SQL Server};Server={$host}; Database={$dbname}"$user$pass) or die("Can't connect the MSSQL server.");

    //The num_rows() function for ODBC since the default one always returns -1.
    function num_rows(&$rid) {

    //We can try it at least, right?
    $numodbc_num_rows($rid);
    if (
    $num >= 0) {
    return 
    $num;
    }

    if (!
    odbc_fetch_row($rid1)) {
    odbc_fetch_row($rid0);
    return 
    0;
    }

    if (!
    odbc_fetch_row($rid2)) {
    odbc_fetch_row($rid0);
    return 
    1;
    }

    $lo2;
    $hi8192000;

    while (
    $lo < ($hi 1)) {
    $mid= (int)(($hi $lo) / 2);
    if (
    odbc_fetch_row($rid$mid)) {
    $lo$mid;
    } else {
    $hi$mid;
    }
    }
    $num$lo;
    odbc_fetch_row($rid0);
    return 
    $num;
    }

    //Query time.
    $query odbc_exec($connect,"SELECT CID FROM Character WHERE Name = ''");
    $count num_rows($query);

    while(
    odbc_fetch_row($query))
    {
        
    $cid odbc_result($query1);
        
        
    odbc_exec($connect,"DELETE FROM CharacterItem WHERE CID = '" $cid "'");
        
    odbc_exec($connect,"DELETE FROM Character WHERE CID = '" $cid "'");
        
        echo 
    "Removed the character with CID " $cid ". <br />";
    }

    echo 
    $count " characters have been totally removed out of the database.";
    ?>
    This server to remove the strings of char that have created as "null".

    Now to me the same script that would do the same thing but for the clan.

    Thanks for any replies.


  2. #2
    Proficient Member Lolled is offline
    MemberRank
    Jan 2010 Join Date
    185Posts

    Re: Delete Null Clan

    upp........

  3. #3
    Valued Member Lifeles5 is offline
    MemberRank
    Mar 2008 Join Date
    147Posts

    Re: Delete Null Clan

    If you have it then whats the problem?

  4. #4
    joe's **** stealhtfire is offline
    MemberRank
    Jul 2008 Join Date
    notwhereiwanttoLocation
    243Posts

    Re: Delete Null Clan

    Quote Originally Posted by Lifeles5 View Post
    If you have it then whats the problem?
    if you look propperly you will see he has the script for deleting chars
    he is asking for a script just alike to delete clans

  5. #5
    Account Upgraded | Title Enabled! wtfhacker is offline
    MemberRank
    Dec 2009 Join Date
    328Posts

    Re: Delete Null Clan

    CID to CLID, Character to Clan, and others can be ClanHonourRanking or delete..

  6. #6
    Account Upgraded | Title Enabled! alfredao is offline
    MemberRank
    Jan 2008 Join Date
    Coronel FabriciLocation
    705Posts

    Re: Delete Null Clan

    DELETE FROM Clan WHERE Name = ''
    DELETE FROM ClanMember WHERE CLID NOT IN (SELECT CLID FROM Clan)

  7. #7
    Proficient Member Lolled is offline
    MemberRank
    Jan 2010 Join Date
    185Posts

    Re: Delete Null Clan

    Thanks guys, but I did not understand some things.
    You could not rewrite the script for clans?
    Last edited by Lolled; 09-04-10 at 04:28 PM.

  8. #8
    Proficient Member Lolled is offline
    MemberRank
    Jan 2010 Join Date
    185Posts

    Re: Delete Null Clan

    Upp....please.

  9. #9
    joe's **** stealhtfire is offline
    MemberRank
    Jul 2008 Join Date
    notwhereiwanttoLocation
    243Posts

    Re: Delete Null Clan

    i believe its bump not upp...please lol
    anyways
    if u make the changes provided, in the script you provided
    its a new script for clans

    so there is no need to re-write it
    Last edited by stealhtfire; 09-04-10 at 05:01 PM.

  10. #10
    Account Upgraded | Title Enabled! alfredao is offline
    MemberRank
    Jan 2008 Join Date
    Coronel FabriciLocation
    705Posts

    Re: Delete Null Clan

    change this
    PHP Code:
    //Query time.
    $query odbc_exec($connect,"SELECT CID FROM Character WHERE Name = ''");
    $count num_rows($query);

    while(
    odbc_fetch_row($query))
    {
        
    $cid odbc_result($query1);
        
        
    odbc_exec($connect,"DELETE FROM CharacterItem WHERE CID = '" $cid "'");
        
    odbc_exec($connect,"DELETE FROM Character WHERE CID = '" $cid "'");
        
        echo 
    "Removed the character with CID " $cid ". <br />";

    to this

    PHP Code:
    //Query time.
    $query odbc_exec($connect,"SELECT CLID FROM Clan WHERE Name = ''");
    $count num_rows($query);

    while(
    odbc_fetch_row($query))
    {
        
    $cid odbc_result($query1);
        
        
    odbc_exec($connect,"DELETE FROM Clanmember WHERE CLID = '" $cid "'");
        
    odbc_exec($connect,"DELETE FROM Clan WHERE CLID = '" $cid "'");
        
        echo 
    "Removed the clan with CLID " $cid ". <br />";


  11. #11
    Proficient Member Lolled is offline
    MemberRank
    Jan 2010 Join Date
    185Posts

    Re: Delete Null Clan

    Quote Originally Posted by alfredao View Post
    change this
    PHP Code:
    //Query time.
    $query odbc_exec($connect,"SELECT CID FROM Character WHERE Name = ''");
    $count num_rows($query);

    while(
    odbc_fetch_row($query))
    {
        
    $cid odbc_result($query1);
        
        
    odbc_exec($connect,"DELETE FROM CharacterItem WHERE CID = '" $cid "'");
        
    odbc_exec($connect,"DELETE FROM Character WHERE CID = '" $cid "'");
        
        echo 
    "Removed the character with CID " $cid ". <br />";

    to this

    PHP Code:
    //Query time.
    $query odbc_exec($connect,"SELECT CLID FROM Clan WHERE Name = ''");
    $count num_rows($query);

    while(
    odbc_fetch_row($query))
    {
        
    $cid odbc_result($query1);
        
        
    odbc_exec($connect,"DELETE FROM Clanmember WHERE CLID = '" $cid "'");
        
    odbc_exec($connect,"DELETE FROM Clan WHERE CLID = '" $cid "'");
        
        echo 
    "Removed the clan with CLID " $cid ". <br />";

    Thanks very much Alfredao,but don't work <_<.
    Any idea?

  12. #12
    Proficient Member Lolled is offline
    MemberRank
    Jan 2010 Join Date
    185Posts

    Re: Delete Null Clan

    Bump....

  13. #13

    Re: Delete Null Clan

    Quote Originally Posted by phoenix_147 View Post
    I think alfredao forgot to change cid to clid.

    @Lolled: Change this is in the original character script:

    Code:
    //Query time.
    $query = odbc_exec($connect,"SELECT CLID FROM Clan WHERE Name = ''");
    $count = num_rows($query);
    
    while(odbc_fetch_row($query))
    {
        $cid = odbc_result($query, 1);
        
        odbc_exec($connect,"DELETE FROM Clanmember WHERE CLID = '" . $clid . "'");
        odbc_exec($connect,"DELETE FROM Clan WHERE CLID = '" . $clid . "'");
        
        echo "Removed the clan with CLID " . $clid . ". <br />";
    }
    It's alfredao's change with a mistake edited.
    You can assign a variable with any name.

    Your snippet broke the function of the entire script.

    *added.
    Last edited by Linear88; 13-04-10 at 04:59 PM.

  14. #14
    Account Upgraded | Title Enabled! gatsu is offline
    MemberRank
    Nov 2008 Join Date
    ItalyLocation
    250Posts

    Re: Delete Null Clan

    Quote Originally Posted by Linear88 View Post
    You can assign a variable with any name.

    Your snippet broke the function of the entire script.

    *added.
    It's same with $clid.
    Don't work!

  15. #15
    num num num <3 rootbeer daniel131605 is offline
    MemberRank
    Jul 2008 Join Date
    New YorkLocation
    573Posts

    Re: Delete Null Clan

    omg lol! this took a lot of trail and error but i finally got it to work :)! This works 100% here you go:

    <?php
    //Written by Wizkid Edited by daniel131605
    //Copyright 2008 - 2009

    //Let us connect the databases.
    //Yeah yeah, ODBC this time.
    $host = "host"; //The host.
    $user = "sa"; //The username.
    $pass = "******"; //The password. I hope it's unique for you.
    $dbname = "GunzDB"; //The dbname. Most likely GunzDB.

    $connect = odbc_connect("Driver={SQL Server};Server={$host}; Database={$dbname}", $user, $pass) or die("Can't connect the MSSQL server.");

    //The num_rows() function for ODBC since the default one always returns -1.
    function num_rows(&$rid) {

    //We can try it at least, right?
    $num= odbc_num_rows($rid);
    if ($num >= 0) {
    return $num;
    }

    if (!odbc_fetch_row($rid, 1)) {
    odbc_fetch_row($rid, 0);
    return 0;
    }

    if (!odbc_fetch_row($rid, 2)) {
    odbc_fetch_row($rid, 0);
    return 1;
    }

    $lo= 2;
    $hi= 8192000;

    while ($lo < ($hi - 1)) {
    $mid= (int)(($hi + $lo) / 2);
    if (odbc_fetch_row($rid, $mid)) {
    $lo= $mid;
    } else {
    $hi= $mid;
    }
    }
    $num= $lo;
    odbc_fetch_row($rid, 0);
    return $num;
    }

    //Query time.
    $query = odbc_exec($connect,"SELECT CLID FROM Clan WHERE Name = ''");
    $count = num_rows($query);

    while(odbc_fetch_row($query))
    {
    $clid = odbc_result($query, 1);

    odbc_exec($connect,"DELETE FROM Clanmember WHERE CLID = '" . $clid . "'");
    odbc_exec($connect,"DELETE FROM Clan WHERE CLID = '" . $clid . "'");


    echo "Removed the clan with CLID " . $clid . ". <br />";
    }

    echo $count . " clans have been totally removed out of the database.";
    ?>


    ---------- Post added at 07:37 PM ---------- Previous post was at 06:00 PM ----------

    /bump, thank me please for fixing the code
    Last edited by daniel131605; 14-04-10 at 09:33 PM.

  16. #16
    Proficient Member Lolled is offline
    MemberRank
    Jan 2010 Join Date
    185Posts

    Re: Delete Null Clan

    It's same:

  17. #17
    num num num <3 rootbeer daniel131605 is offline
    MemberRank
    Jul 2008 Join Date
    New YorkLocation
    573Posts

    Re: Delete Null Clan

    go into your database and click on the clan names you want to get rid of and hit space then enter so the name is blank then go to the next one, its very easy... if i knew what the *null* term was i would tell you, but if you figure out what it is just replace
    SELECT CLID FROM Clan WHERE Name = 'null/null code'");

  18. #18
    Apprentice ploke012 is offline
    MemberRank
    Apr 2010 Join Date
    17Posts

    Re: Delete Null Clan

    you need to get serial key for photoshp for this

    ---------- Post added at 02:45 PM ---------- Previous post was at 02:39 PM ----------

    fake code above , super fake

  19. #19
    num num num <3 rootbeer daniel131605 is offline
    MemberRank
    Jul 2008 Join Date
    New YorkLocation
    573Posts

    Re: Delete Null Clan

    Quote Originally Posted by ploke012 View Post
    you need to get serial key for photoshp for this

    ---------- Post added at 02:45 PM ---------- Previous post was at 02:39 PM ----------

    fake code above , super fake
    fail? this isn't about photoshop xD



Advertisement