Coinbase

Author Topic: Unknown column 'CATEGORY' in 'field list'  (Read 11961 times)

0 Members and 1 Guest are viewing this topic.

Offline colonel_t

  • Jr. Member
  • **
  • Posts: 11
    • Email
Unknown column 'CATEGORY' in 'field list'
« on: March 11, 2007, 04:12:08 am »
I got this error message when I tried to replace an ad in the ad management section.
Unknown column 'CATEGORY' in 'field list'
File: c:\hosting\webhost4life\member\slmbodywork1\forum\Sources\Ads.php
Line: 289


Line 289 : $adsUpdate[] = 'show_topofpage = ' . (empty($_POST['show_topofpage']) ? '0' : '1');

Default theme, SMF 1.1.2. Ad mod 2.3


Any ideas?

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Unknown column 'CATEGORY' in 'field list'
« Reply #1 on: March 14, 2007, 02:40:57 pm »
Is the Ads.php file in the Sources directory. ???

Offline colonel_t

  • Jr. Member
  • **
  • Posts: 11
    • Email
Re: Unknown column 'CATEGORY' in 'field list'
« Reply #2 on: March 14, 2007, 03:30:00 pm »
Yep.

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Unknown column 'CATEGORY' in 'field list'
« Reply #3 on: March 15, 2007, 06:54:49 pm »
re-upload it and see what happens. If that doesn't work this is probably a database error. I will have to let Jerm know.

Offline colonel_t

  • Jr. Member
  • **
  • Posts: 11
    • Email
Re: Unknown column 'CATEGORY' in 'field list'
« Reply #4 on: March 15, 2007, 07:00:52 pm »
Done, no change.


Could there be an issue in that the ads were originally from an earlier version of the ad mod? Perhaps they're not completely compatible with this newest version.

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Unknown column 'CATEGORY' in 'field list'
« Reply #5 on: March 15, 2007, 07:02:24 pm »
The ads you place yourself and they should have nothing to do with the version of ad mod you are running.

Offline jerm

  • Support
  • Elite Member
  • *
  • Posts: 726
Re: Unknown column 'CATEGORY' in 'field list'
« Reply #6 on: March 17, 2007, 11:16:12 pm »
The table didn't get created properly. You can try uninstalling the mod and reinstalling it.

Offline atech

  • Newbie
  • *
  • Posts: 1
Re: Unknown column 'CATEGORY' in 'field list'
« Reply #7 on: April 13, 2007, 01:42:47 pm »
what table was not created properly.  the mod i downloaded did not create any tables ... help !!

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Unknown column 'CATEGORY' in 'field list'
« Reply #8 on: April 16, 2007, 06:35:43 pm »
You can try uninstalling the mod and reinstalling it.

Offline che1974

  • Newbie
  • *
  • Posts: 1
Re: Unknown column 'CATEGORY' in 'field list'
« Reply #9 on: May 27, 2007, 11:53:27 pm »
There is no Table 'CATEGORY' in the DB.

Code: [Select]
if (!defined('SMF'))
die('Hacking attempt...');

function loadads()
{
global $db_prefix;
global $adverts;

$query = db_query("
SELECT *
FROM {$db_prefix}ads
order by ADS_ID", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($query))
{
$adverts[] = array(
'id' => $row['ADS_ID'],
'name' => $row['NAME'],
'content' => $row['CONTENT'],                 
'boards' => $row['BOARDS'],
'posts' => $row['POSTS'],                       
'category' => $row['CATEGORY'],             // <-- there is no table 'CATEGORY' in the DB
'hits' => $row['HITS'],

Look into the install.php

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__);

i start to build a new Table in the DB
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,
CATEGORY text,                                    //   <-- this will install the new table 
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__);

now it runs on pragmamx with smf 1.1.2

I will have one problem to.
After the install of this mod.

When i will go to the admin section of the forum, there is no link for administration in my adminprofile.
I tipp manually Forum&action=admin in the browser, then i will get the forum admin page.
Anyone a Idee where i can change this.

P.s. sorry for my english  ;)

Offline teclive

  • Newbie
  • *
  • Posts: 5
    • Email
Re: Unknown column 'CATEGORY' in 'field list'
« Reply #10 on: June 05, 2007, 06:48:35 pm »
i get the same problem, and i have run the queries in the db, i did a complete manual install and this is what i get

Unknown column 'CATEGORY' in 'field list'
File: /var/www/vhosts/seasonedtradelines.net/httpdocs/community/Sources/Ads.php
Line: 289

this is line 289

   WHERE ADS_ID = '$_REQUEST[ad]'", __FILE__, __LINE__);

smf 1.1.2   smfad 2.3


SMF Ads Support Forum

Re: Unknown column 'CATEGORY' in 'field list'
« Reply #10 on: June 05, 2007, 06:48:35 pm »
.

 

.