1
AWDMolitov
Dropping SQLTable on uninstall?

Hello all.

I'm making my own module for XOOPS, but am getting stuck on dropping a table on uninstall, can someone help me on this :)

thank-you
Molitov

2
Dave_L
Re: Dropping SQLTable on uninstall?
  • 2006/5/7 10:17

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


The tables specified in your module's xoops_version.php automatically get added during install and dropped on uninstall:

$modversion['tables'][0] = 'modulename_table1';
$modversion['tables'][1] = 'modulename_table2';
...


Is that not working for your module?

3
AWDMolitov
Re: Dropping SQLTable on uninstall?
  • 2006/5/7 10:21

  • AWDMolitov

  • Just popping in

  • Posts: 23

  • Since: 2005/8/14


ahhh!

I was just using $modversion['sqlfile']['mysql'] = "sql/mysql.sql";
with the sql information in the sql file.

Thanks :)
Just learning how to make modules by copying other modules i use :)

4
AWDMolitov
Re: Dropping SQLTable on uninstall?
  • 2006/5/11 14:04

  • AWDMolitov

  • Just popping in

  • Posts: 23

  • Since: 2005/8/14


another question, but not on dropping tables,

updating them this time....
i currently have this code:

//Meta Redirect
echo "";
echo 
"";
echo 
"";

//Get XOOPS Stuff
include "../../../include/cp_header.php";
xoops_cp_header();

//Retrieve Data from Form
$cid $_POST['cid'];
$pic $_POST['pic'];

//Set MySQL Table
$table $xoopsDB->prefix"bf2stats" ) ;

//Update Table
if (isset($cid)) {
    
$xoopsDB->query("UPDATE `$table` SET `cid` = '$cid', `pic` = '$pic' WHERE `wid` = '1' LIMIT 1");
    }
if (empty(
$cid)) {
    
$cid "Value Empty!";
    
$emp "1";
}
if (empty(
$pic)) {
    
$pic "Value Empty!";
        
$emp "1";
}
OpenTable();
?>
Battlefield 2 Stats Supplied By bf2tracker.com


You will be redirected back to the main page in 5 seconds.

    echo "$pic;
  echo 
"$cid;
?>
  

                                    if ($emp === '1') { echo "Database Was Not Updated because one or more         

        variables are missing."
; }
            if (empty(
$emp)) { echo "Database Was successfully updated."; }
            
?>




    
        
            BF2  Tracker Clan ID



                
                echo $cid ?>
      
                
                
                    Display Pictures on Side
                    
                      
                        echo $pic ?>
                  
      
                    
                         
                         
                    
    
CloseTable();
xoops_cp_footer(); 
?>


Now i know the data gets to it from the other form, and it all works, except it doesn't update the database.

Any Ideas?

5
m0nty
Re: Dropping SQLTable on uninstall?
  • 2006/5/11 15:55

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


turn on MySQL debug and see what happens when u submit..

also u might need to add global $xoopsDB; to the beginning of the script..

Login

Who's Online

553 user(s) are online (165 user(s) are browsing Support Forums)


Members: 0


Guests: 553


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits