vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   My sql Help (https://vborg.vbsupport.ru/showthread.php?t=90521)

Sik Micz Tech 03-15-2005 01:50 PM

My sql Help
 
ok i can usually get this stuff to work right. but i need ot convert a Automoatic database installer to a Manual one ao i can add in teh table manualy. i have pasted the code below so if any one can help me convert this to manual. any help on this will be great.



PHP Code:

    // ######################### Run Queries #######################
    
if ($step == 'doqueries')
    {
        
$DB_site->query("CREATE TABLE " TABLE_PREFIX "award (
                awardid smallint(5) unsigned NOT NULL auto_increment,
                name varchar(50) NOT NULL default '',
                description varchar(250) NOT NULL default '',
                icon_url varchar(250) NOT NULL default '',
                PRIMARY KEY    (awardid)
            ) TYPE=MyISAM;
        "
);

        
$DB_site->query("CREATE TABLE " TABLE_PREFIX "useraward (
                userid int(10) NOT NULL auto_increment,
                PRIMARY KEY    (userid)
            ) TYPE=MyISAM;
        "
);

        
// FIX EMPTY USER AWARD TABLE
        
$users $DB_site->query("
            SELECT user.userid
            FROM " 
TABLE_PREFIX "user AS user
            LEFT JOIN " 
TABLE_PREFIX "useraward AS useraward USING(userid)
            WHERE useraward.userid IS NULL
        "
);

        
$userids = array();
        while (
$user $DB_site->fetch_array($users))
        {
            
$userids[] = $user['userid'];
        }

        if (!empty(
$userids))
        {
            
$DB_site->query("INSERT INTO " TABLE_PREFIX "useraward (userid) VALUES (" implode('),('$userids) . ")");
        }

        echo 
"<br />Queries Run!<br /><br />";

        echo 
"<a href=\"awards_install.php?step=dofileedits\"><b>Click here to continue to step 4 --&gt;</b></a><br /><br />\n";
    } 


Jolten 03-15-2005 05:28 PM

You need to just do it manually? Copy and paste the query into phpmyadmin and run it. Or did you need a manual installer version of this hack?

Sik Micz Tech 03-16-2005 11:09 AM

i need that coding made so i can have amanual installer for it. some one delete the Databases that those make and now the VB wont run. iso i need ot make the Database ASAP.


All times are GMT. The time now is 03:25 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00955 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete