Recent Topics

1 Mar 06, 2009 01:37    

This is the error:

[URL=http://img150.imageshack.us/my.php?image=sqlerror.png]http://img150.imageshack.us/img150/3940/sqlerror.th.png[/URL]

This is the code:

	function GetDbLayout()
	{
		$default = array( // Toolbar, both 'allToolar' and initial 'defaultToolbar'
			array( // Row
			[...] // There's much more
			));

		return array(
			'CREATE TABLE '.$this->get_sql_table( 'toolbar' )." (
				id varchar(10) NOT NULL,
				user varchar(25),
				data varchar,
				timestamp int(10) NOT NULL,
				PRIMARY KEY (id)
			  )",
			"INSERT INTO ".$this->get_sql_table( 'toolbar' )."
				(user, timestamp, data)
				VALUES ( 'allToolbar', " . time() ."', '". serialize( $default ) . "')",
			"INSERT INTO ".$this->get_sql_table( 'toolbar' )."
				(user, timestamp, data)
				VALUES ( 'defaultToolbar', " . time() ."', '". serialize( $default ) . "')"
		  );
	}

I don't understand the error and what went wrong:
Error wrote:

The DB schema has been changed since confirmation.

*edit*
Added AUTO_INCREMENT to id but that didn't solve the issue

2 Mar 06, 2009 01:44

Not sure if this will help or not, but I use "AfterInstall" to add bits to tables created by "GetDbLayout".

3 Mar 06, 2009 02:12

EdB wrote:

Not sure if this will help or not, but I use "AfterInstall" to add bits to tables created by "GetDbLayout".

You may be right. This is what happened:
I did as you told and it now started to output SQL errors I could understand.
Main error was a ' after time

" . time() ."'

The DB part seems to work now. On to the logic behind it.

Thanks a lot!

4 Mar 06, 2009 02:49

Afwas wrote:

... Thanks a lot!

Wow! I actually helped one of the Really Smart Players with a technical issue!!! I think that might be the first time *ever* for that type of thing. holy cow I think I'm gonna have an orgasm :D


Form is loading...