Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthormbenney
    • CommentTimeMay 9th 2006
     # 1
    So i completely boned installing v1. It seems that i'd got a part of the way through installing a 0.xx version and then not bothered completing it. So this means it wasn't properly installed and the installer / upgrader in v1 treats it as an upgrade... but this doesn't work, throws a bunch of errors. I don't have admin or control panel access to this database, i also cannot delete the database because its got other stuff that needs to stay... nor can i create a new one. Anyone know a way i can remove all traces of vanilla from this db and start again?

    Sorry for my retardedness, i'm a designer :p

    Knowwhatimsayin?
    •  
      CommentAuthorlech
    • CommentTimeMay 9th 2006
     # 2
    Have you got shell access to the machine in question? Feel like taking a command-line based adventure into the unknown? Or at the very least, installing some tools you may end up using on a regular basis. If the answer is yes to any of these, you can start by hitting up the mysql site and learning how to manually modify/add/remove databases/tables or you might feel it necessary to slap phpmyadmin or a similar tool onto your site to manage databases you have access to.

    Off-hand though, I can't for the life of me remember the syntax for dropping tables as I've been doing other things. If someone could be so kind as to helping benney here, that would be great :D
    •  
      CommentAuthorMark
    • CommentTimeMay 9th 2006
     # 3
    Hmmm. I'd probably write a script that calls show tables on the database in question and then loops through the results, dropping any tables that are prefixed with LUM_
    • CommentAuthormbenney
    • CommentTimeMay 9th 2006
     # 4
    i'm not sure if ive got the access to install phpmyadmin... and its a site that wont have much upkeep once installed. Mark your suggestion sounds like what needs to be done! Anyone got the time to knock this up for me :)? I can trade any design / flash / IA time for any little jobs you might need done...

    Ta
    M
    •  
      CommentAuthorMark
    • CommentTimeMay 9th 2006
     # 5
    <?php
    $DBHost = 'localhost';
    $DBUser = 'your_database_user';
    $DBPass = 'your_database_password';
    $DBName = 'your_database_name';

    $Connection = mysql_connect($DBHost, $DBUser, $DBPass);
    if (!$Connection) {
    echo 'Failed to connect to the database.';
    die();
    } else {
    if (!mysql_select_db($DBName, $Connection)) {
    echo 'Failed to connect to the '.$DBName.' database.';
    die();
    } else {
    // If the database connection worked, get the tables in the db
    $TableData = mysql_query('show tables', $Connection);
    if (!$TableData) {
    echo 'Failed to retrieve tables from database.';
    die();
    } else {
    while ($Row = mysql_fetch_array($TableData)) {
    $TableName = $Row[0];
    if (strpos($TableName, 'LUM_') === false) {
    // Do nothing, LUM_ was not found
    } else {
    if (!mysql_query('drop table '.$TableName, $Connection)) {
    echo 'Failed to drop table '.$TableName;
    die();
    }
    }
    }
    }
    }
    }
    ?>


    That's it. I haven't tested it or anything, use at your own risk. I recommend backing up your db before you use this.
    • CommentAuthormbenney
    • CommentTimeMay 9th 2006
     # 6
    That looks good to me :)

    if (strpos($TableName, 'LUM_') === false) {

    whats with the triple equals? Is that a PHP thing? Im a pure actionscript boy =)
    •  
      CommentAuthorBergamot
    • CommentTimeMay 9th 2006
     # 7
    Triple equals tests without implicit format conversions.
    • CommentAuthormbenney
    • CommentTimeMay 9th 2006
     # 8
    Fantastic. It worked like a charm. Thankyou Mark... let me know if theres anything I can help you with.

    Sorry community for taking up valuable coding time :)
Add your comments
    Username Password
  • Format comments as