Coinbase

Author Topic: problem with de DB  (Read 5077 times)

0 Members and 1 Guest are viewing this topic.

Offline cazador

  • Newbie
  • *
  • Posts: 1
problem with de DB
« on: March 18, 2007, 09:23:37 am »
Hello guys
I got a problem with the ad manager mod. I Installed it manual, but I don't know how to do the DB, I'll try it by the packages admi, and all the pages of the forum turn white. Everything desapear.
I got de default theme, an the dir It's this http://argentronicap2p.ueuo.com/

help me please, I don't know what to do, or the way to create de DB tables

Code: [Select]
<?php

/*
Installing the ad mod for the first time
*/
db_query("
CREATE TABLE IF NOT EXISTS 
{$db_prefix}ads (
ADS_ID mediumint(8) unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
HITS mediumint(8) NOT NULL default '0',
TYPE smallint(4) NOT NULL default '0',
show_index smallint(4) NOT NULL default '0',
show_board smallint(4) NOT NULL default '0',
show_threadindex smallint(4) NOT NULL default '0',
show_lastpost smallint(4) NOT NULL default '0',
show_thread smallint(4) NOT NULL default '0',
show_bottom smallint(4) NOT NULL default '0',
show_welcome smallint(4) NOT NULL default '0',
show_topofpage smallint(4) NOT NULL default '0',
show_towerright smallint(4) NOT NULL default '0',
show_towerleft smallint(4) NOT NULL default '0',
show_betweencategories smallint(4) NOT NULL default '0',
show_underchildren smallint(4) NOT NULL default '0',
PRIMARY KEY (ADS_ID)
)"
__FILE____LINE__);

db_query("
CREATE TABLE IF NOT EXISTS 
{$db_prefix}ads_settings (
  variable tinytext NOT NULL,
  value text NOT NULL,
  PRIMARY KEY (variable(30))
)"
__FILE____LINE__);

/*
If you've already had the mod installed this will just make sure that you have the most current version of the database
*/
$result db_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'show_lastpost'"__FILE____LINE__);
if (
mysql_num_rows($result) == 0)
db_query("
ALTER IGNORE TABLE 
{$db_prefix}ads
ADD show_lastpost smallint(4) NOT NULL default '0' AFTER show_threadindex"
__FILE____LINE__);

$result db_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'CATEGORY'"__FILE____LINE__);
if (
mysql_num_rows($result) == 0)
db_query("
ALTER IGNORE TABLE 
{$db_prefix}ads
ADD CATEGORY tinytext AFTER POSTS"
__FILE____LINE__);

$result db_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'show_underchildren'"__FILE____LINE__);
if (
mysql_num_rows($result) == 0)
db_query("
ALTER IGNORE TABLE 
{$db_prefix}ads
ADD show_underchildren smallint(4) NOT NULL default '0'"
__FILE____LINE__);


/*
Inserts into the settings table
*/
db_query("
INSERT IGNORE INTO 
{$db_prefix}settings
(variable, value)
VALUES ('ads_displayAdsAdmin', '0'),
('ads_updateReports', '0'),
('ads_quickDisable', '0'),
('ads_lookLikePosts', '1')"
__FILE____LINE__);
?>



Thanks
« Last Edit: March 18, 2007, 09:55:47 am by cazador »

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: problem with de DB
« Reply #1 on: March 20, 2007, 01:14:02 am »
I will leave this for Jerm to answer as he may know better.

Offline jerm

  • Support
  • Elite Member
  • *
  • Posts: 726
Re: problem with de DB
« Reply #2 on: March 20, 2007, 10:19:27 pm »
You'll need to use phpmyadmin and add this to your smf table:
Code: [Select]
CREATE TABLE IF NOT EXISTS {$db_prefix}ads (
ADS_ID mediumint(8) unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
HITS mediumint(8) NOT NULL default '0',
TYPE smallint(4) NOT NULL default '0',
show_index smallint(4) NOT NULL default '0',
show_board smallint(4) NOT NULL default '0',
show_threadindex smallint(4) NOT NULL default '0',
show_lastpost smallint(4) NOT NULL default '0',
show_thread smallint(4) NOT NULL default '0',
show_bottom smallint(4) NOT NULL default '0',
show_welcome smallint(4) NOT NULL default '0',
show_topofpage smallint(4) NOT NULL default '0',
show_towerright smallint(4) NOT NULL default '0',
show_towerleft smallint(4) NOT NULL default '0',
show_betweencategories smallint(4) NOT NULL default '0',
show_underchildren smallint(4) NOT NULL default '0',
PRIMARY KEY (ADS_ID)
)

Offline anakmacan

  • Newbie
  • *
  • Posts: 6
Same question.
« Reply #3 on: June 01, 2007, 07:53:22 am »
can you help us for each step, uploading the data in install.php to database?
Ive opened my phpmyadmin, then open my smf database, but i dont know what to do next. When i tried copying like you said from "Sql" (Run SQL query/queries on database), i got error message.

How do we add all of them into our db?
Quote
Code: [Select]
<?php

/*
Installing the ad mod for the first time
*/
mysql_query("
CREATE TABLE IF NOT EXISTS 
{$db_prefix}ads (
ADS_ID mediumint(8) unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
HITS mediumint(8) NOT NULL default '0',
TYPE smallint(4) NOT NULL default '0',
show_index smallint(4) NOT NULL default '0',
show_board smallint(4) NOT NULL default '0',
show_threadindex smallint(4) NOT NULL default '0',
show_lastpost smallint(4) NOT NULL default '0',
show_thread smallint(4) NOT NULL default '0',
show_bottom smallint(4) NOT NULL default '0',
show_welcome smallint(4) NOT NULL default '0',
show_topofpage smallint(4) NOT NULL default '0',
show_towerright smallint(4) NOT NULL default '0',
show_towerleft smallint(4) NOT NULL default '0',
show_betweencategories smallint(4) NOT NULL default '0',
show_underchildren smallint(4) NOT NULL default '0',
PRIMARY KEY (ADS_ID)
)"
__FILE____LINE__);

mysql_query("
CREATE TABLE IF NOT EXISTS 
{$db_prefix}ads_settings (
  variable tinytext NOT NULL,
  value text NOT NULL,
  PRIMARY KEY (variable(30))
)"
__FILE____LINE__);

/*
If you've already had the mod installed this will just make sure that you have the most current version of the database
*/
$result mysql_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'show_lastpost'"__FILE____LINE__);
if (
mysql_num_rows($result) == 0)
mysql_query("
ALTER IGNORE TABLE 
{$db_prefix}ads
ADD show_lastpost smallint(4) NOT NULL default '0' AFTER show_threadindex"
__FILE____LINE__);

$result mysql_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'CATEGORY'"__FILE____LINE__);
if (
mysql_num_rows($result) == 0)
mysql_query("
ALTER IGNORE TABLE 
{$db_prefix}ads
ADD CATEGORY tinytext AFTER POSTS"
__FILE____LINE__);

$result mysql_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'show_underchildren'"__FILE____LINE__);
if (
mysql_num_rows($result) == 0)
mysql_query("
ALTER IGNORE TABLE 
{$db_prefix}ads
ADD show_underchildren smallint(4) NOT NULL default '0'"
__FILE____LINE__);


/*
Inserts into the settings table
*/
mysql_query("
INSERT IGNORE INTO 
{$db_prefix}settings
(variable, value)
VALUES ('ads_displayAdsAdmin', '0'),
('ads_updateReports', '0'),
('ads_quickDisable', '0'),
('ads_lookLikePosts', '1')"
__FILE____LINE__);
?>
« Last Edit: June 01, 2007, 07:54:54 am by anakmacan »

Offline ITA003

  • Jr. Member
  • **
  • Posts: 63
Re: problem with de DB
« Reply #4 on: June 01, 2007, 08:11:13 am »
Do you have problem with Package install procedure?

Offline anakmacan

  • Newbie
  • *
  • Posts: 6
Re: problem with de DB
« Reply #5 on: June 01, 2007, 05:33:34 pm »
Yep, i installed at first, but since it didnt work well i uninstall it, after that i cant install anymore package (dunno what i did wrong) o_O Ive edited all theme files now all i have to do is to add those tables,etc into mysql, i just dont know how to do it  ::)

Offline anakmacan

  • Newbie
  • *
  • Posts: 6
Re: problem with de DB
« Reply #6 on: June 01, 2007, 05:37:05 pm »
So, basically im just clueless, anyone wanna give me a hand? pls? :-\ mammamia..  :'(

Offline ITA003

  • Jr. Member
  • **
  • Posts: 63
Re: problem with de DB
« Reply #7 on: June 02, 2007, 02:59:23 am »
Ok.

From PhpMyAdmin you must execute these query, be careful to this php variable {$db_prefix} (present in all query), you must replace it with your SMF Table prefix (usually smf_):

Code: [Select]
CREATE TABLE IF NOT EXISTS {$db_prefix}ads (
ADS_ID mediumint(8) unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
HITS mediumint(8) NOT NULL default '0',
TYPE smallint(4) NOT NULL default '0',
show_index smallint(4) NOT NULL default '0',
show_board smallint(4) NOT NULL default '0',
show_threadindex smallint(4) NOT NULL default '0',
show_lastpost smallint(4) NOT NULL default '0',
show_thread smallint(4) NOT NULL default '0',
show_bottom smallint(4) NOT NULL default '0',
show_welcome smallint(4) NOT NULL default '0',
show_topofpage smallint(4) NOT NULL default '0',
show_towerright smallint(4) NOT NULL default '0',
show_towerleft smallint(4) NOT NULL default '0',
show_betweencategories smallint(4) NOT NULL default '0',
show_underchildren smallint(4) NOT NULL default '0',
PRIMARY KEY (ADS_ID)

Code: [Select]
CREATE TABLE IF NOT EXISTS {$db_prefix}ads_settings (
  variable tinytext NOT NULL,
  value text NOT NULL,
  PRIMARY KEY (variable(30))

Code: [Select]
INSERT IGNORE INTO {$db_prefix}settings
(variable, value)
VALUES ('ads_displayAdsAdmin', '0'),
('ads_updateReports', '0'),
('ads_quickDisable', '0'),
('ads_lookLikePosts', '1')


SMF Ads Support Forum

Re: problem with de DB
« Reply #7 on: June 02, 2007, 02:59:23 am »
.

 

.