Webmastersite.net
Register Log In

Error adding new database table

Comments on Error adding new database table

FirstByteMedia
Member

Usergroup: Customer
Joined: Feb 04, 2006

Total Topics: 8
Total Comments: 22
Posted Oct 28, 2008 - 9:21 AM:

Hi Paul,

I've been playing around with the 5 series and was having some issues with the "Adding Database Tables" tutorial.

I've successfully create the table in mysql and can be seen from within the Toplist Generator feature in the Admin panel.

Though when i initate the page via the link "generics.php?action=add&classname=widgets" i get the following error message.

Fatal error: Class 'widgets' not found in /home/firstbyt/public_html/test_5/generics.php on line 69

Any idea where i might have gone wrong?

below is the database query.

regards

FBM

CREATE TABLE IF NOT EXISTS `wsnlinks_widgets` (
`id` int(11) NOT NULL auto_increment,
`time` timestamp NOT NULL default CURRENT_TIMESTAMP,
`lastedit` time NOT NULL default '00:00:00',
`amount` int(11) NOT NULL default '0',
`ownerid` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 28, 2008 - 4:07 PM:

It says you didn't add the class. If you do just the table without the class then you can only do toplists and not additions/edits/etc.
FirstByteMedia
Member

Usergroup: Customer
Joined: Feb 04, 2006

Total Topics: 8
Total Comments: 22
Posted Oct 28, 2008 - 5:00 PM:

Hi Paul.

thanks for the reply.

If you mean that i've forgotten to create the /classes/widget.php file and template files. that been done already.

The files have been uploaded and sitting in the appropriate folders. I've been over the tutorial for a few hours and can't find which step I've missed.

The tutorial did say it was introduced in 5.0.0 Alpha 3, is the tutorial still valid?

regards
FBM
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 30, 2008 - 8:12 AM:

What's the content of your classes/widget.php?
FirstByteMedia
Member

Usergroup: Customer
Joined: Feb 04, 2006

Total Topics: 8
Total Comments: 22
Posted Oct 30, 2008 - 10:08 AM:

HI Paul,

The only changes were thoses on the tutorial.

code below.

<?php

class search extends generic
{

function __construct($type, $input)
{ // constructor
global $language;
$this->objecttype = 'widgets';
$this->objecttable = 'widgetstable';
$this->objectdateformat = $language->dateformat_comments;
parent::__construct($type, $input);
}

function canview() { return true; }

}


?>
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 31, 2008 - 12:19 PM:

If you're doing a widgets table, it should be class widgets -- class search is for the search table.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.