Click to See Complete Forum and Search --> : Error Inserting data???????


solidariti
02-06-2006, 06:57 AM
can someone please help me, and tell me why I keep getting this error, I believe that it is the autoincremented opponentid as I'm inserting '', is that right.


SQL Error:

SQL Error DB function failed with error number 1146
Table 'appsjame_uwafc.#_league_opponents' doesn't exist SQL=INSERT INTO `#_league_opponents` (`opponentid`, `opponentname`, `opponentown`, `opponenturl`, `opponentemail`, `opponentphone`, `opponentcontact`, `published`, `areaid`, `founded`, `colors`, `stadium`, `short`) VALUES ('', 'Arsenal', 0, '', '', '', '', 1, 1, '', '', '', '');
SQL =

INSERT INTO `#_league_opponents` (`opponentid`, `opponentname`, `opponentown`, `opponenturl`, `opponentemail`, `opponentphone`, `opponentcontact`, `published`, `areaid`, `founded`, `colors`, `stadium`, `short`) VALUES ('', 'Arsenal', 0, '', '', '', '', 1, 1, '', '', '', '');


SQL Query:

CREATE TABLE #__league_opponents (
opponentid smallint(4) unsigned NOT NULL auto_increment,
opponentname varchar(128) NOT NULL default '',
opponentown tinyint(1) unsigned NOT NULL default '0',
opponenturl varchar(80) NOT NULL default '',
opponentemail varchar(80) NOT NULL default '',
opponentphone varchar(80) NOT NULL default '',
opponentcontact varchar(255) NOT NULL default '',
published tinyint(1) NOT NULL default '0',
areaid int(4) unsigned NOT NULL default '0',
founded varchar(4) NOT NULL default '',
colors varchar(40) NOT NULL default '',
stadium varchar(40) NOT NULL default '',
short varchar(4) NOT NULL default '',
imagefiles varchar(150) NOT NULL default '',
PRIMARY KEY (opponentid)
) TYPE=MyISAM

INSERT INTO `#__league_opponents` (`opponentid`, `opponentname`, `opponentown`, `opponenturl`, `opponentemail`, `opponentphone`, `opponentcontact`, `published`, `areaid`, `founded`, `colors`, `stadium`, `short`) VALUES ('', 'Mancester', 0, '', '', '', '', 1, 1, '', '', '', 'MANU');

INSERT INTO `#_league_opponents` (`opponentid`, `opponentname`, `opponentown`, `opponenturl`, `opponentemail`, `opponentphone`, `opponentcontact`, `published`, `areaid`, `founded`, `colors`, `stadium`, `short`) VALUES ('', 'Arsenal', 0, '', '', '', '', 1, 1, '', '', '', '');


Thank you big time in advance

chazzy
02-06-2006, 07:07 PM
are you creating the table right as you insert the data? could you should the programming logic maybe?

Nevermind that part

just noticed this though:

INSERT INTO `#__league_opponents`

INSERT INTO `#_league_opponents`

See the difference in the two lines? one has #__ and the other is $_. Your table is #__

solidariti
02-07-2006, 04:13 AM
Thank you I see no that one of them has 1 underscore while the other has 2, thank you, I'll see if that works cheers chazzy, I can so you the logic if you want?