PDA

View Full Version : help formulating a install query.


Vaupell
02-03-2009, 09:14 PM
Im stuck so many places, gotta debug one point at a time.
gonna start with installation.

need to create a table with some content ;)

allright home/local i use navicat lite (free and lovely)
and goto the vbulletin table i made named vbinvitationcode + prefix ofc
and click dump a backup. i open the backup to get the "ordenary" query
and want to convert that into something usefull for vb..

DROP TABLE IF EXISTS `vbinvitationcode`;
CREATE TABLE `vbinvitationcode` (
`codedbID` int(10) NOT NULL AUTO_INCREMENT,
`InvitationCODE` longtext,
`NewusergroupID` int(2) DEFAULT NULL,
PRIMARY KEY (`codedbID`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

Now for vb i then make it into : :eek:


$db->hide_errors();
$db->query_write("CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "vbinvitationcode` (
`codedbID` int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`InvitationCODE` longtext,
`NewusergroupID` int(2) DEFAULT NULL,
$db->show_errors();

and with a blink of an eye it appears everything is normal, but infact
it never made the table.. :confused:

whats wrong ? :):up:


allready reported myself for wrong category :p

Lynne
02-03-2009, 11:03 PM
Maybe..

$db->hide_errors();
$db->query_write("CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "vbinvitationcode` (
`codedbID` int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`InvitationCODE` longtext,
`NewusergroupID` int(2) DEFAULT NULL)
");
$db->show_errors();

Vaupell
02-03-2009, 11:30 PM
OMG Lynne youre a lifesaver,,

Thank you soooo much, you made my day.. :D:up:

Dismounted
02-04-2009, 04:58 AM
You may want to get an editor that includes PHP highlighting. This would reveal "silly" mistakes like this.

Marco van Herwaarden
02-04-2009, 08:20 AM
You are also missing the key:

PRIMARY KEY (`codedbID`)
Also next time, remove the hide_errors to see why it fails.

Vaupell
02-04-2009, 08:29 AM
You may want to get an editor that includes PHP highlighting. This would reveal "silly" mistakes like this.

any particular recommended ? :):up:

You are also missing the key:

PRIMARY KEY (`codedbID`)
Also next time, remove the hide_errors to see why it fails.

Well ofcourse i removed the hide_errors to test, but didnt show anything
now ewen a sql error, just blinked twice then refresh and nothing. :P

Dismounted
02-04-2009, 10:42 AM
any particular recommended ?
I use Komodo IDE. However, the same company (ActiveState) also releases an open-source version called Komodo Edit. It just drops a few of the debugging/advanced features.

Vaupell
02-11-2009, 09:59 AM
@Dismounted > yes Komodo yes great, tx using the free one now..