Block Install - Something up with db.xml?
Permalink
Hi Everyone
Can't find an answer to this and its frustrating me when I install me block in to my test environment i get the attached error and no block available. my db.xml code is below..
Please please help me someone!
Cheers Justin
Can't find an answer to this and its frustrating me when I install me block in to my test environment i get the attached error and no block available. my db.xml code is below..
<?xml version="1.0"?> <schema version="0.3"> <table name="btZRSSReader"> <field name="bID" type="I"> <key></key> <unsigned></unsigned> </field> <field name="url" type="C" size="255"> </field> <field name="limit" type="C" size="255"> </field> <field name="header" type="L"> </field> <field name="titletag" type="C" size="255"> </field>
Viewing 15 lines of 27 lines. View entire code block.
Please please help me someone!
Cheers Justin
Cheers for this Ollie I have update my script and I am still getting the same error and it makes no sense as I essentially copied this from another block add on. any thoughts, or anyone else?
cheers everyone
<?xml version="1.0"?> <schema version="0.3"> <table name="btZRSSReader"> <field name="bID" type="I"> <key /> <unsigned /> </field> <field name="rss_url" type="C" size="255"> </field> <field name="rss_posts_limit" type="I"> <unsigned /> </field> <field name="rss_header" type="C"> <unsigned /> <notnull />
Viewing 15 lines of 43 lines. View entire code block.
cheers everyone
Easy one actually - you'll kick yourself!
'Limit' is a MySQL reserved word. It looks like C5 or adodb isn't wrapping the field names in back ticks. Easiest thing to do is to change the name of the limit column and it should go through just fine...
Jon
'Limit' is a MySQL reserved word. It looks like C5 or adodb isn't wrapping the field names in back ticks. Easiest thing to do is to change the name of the limit column and it should go through just fine...
Jon
Jon
Thanks mate did what you said but no joy i get this error
The following errors occurred when attempting to process your request:
mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNSIGNED NOT NULL DEFAULT 'true', rss_titletag VARCHAR(255), rss_dat' at line 5] in EXECUTE("CREATE TABLE btZRSSReader ( bID INTEGER UNSIGNED NOT NULL, rss_url VARCHAR(255), rss_posts_size INTEGER UNSIGNED, rss_header VARCHAR UNSIGNED NOT NULL DEFAULT 'true', rss_titletag VARCHAR(255), rss_date VARCHAR UNSIGNED NOT NULL DEFAULT 'true', rss_content VARCHAR UNSIGNED NOT NULL DEFAULT 'true', rss_snippet VARCHAR UNSIGNED NOT NULL DEFAULT 'true', rss_showerror VARCHAR UNSIGNED NOT NULL DEFAULT 'true', rss_googleapi_key LONGTEXT, PRIMARY KEY (bID) )")
Nightmare, My first block and I am already ready to give up ;)
I have attached A screen shot of my MySQL Version and PHP stuff if that helps
Thanks mate did what you said but no joy i get this error
The following errors occurred when attempting to process your request:
mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNSIGNED NOT NULL DEFAULT 'true', rss_titletag VARCHAR(255), rss_dat' at line 5] in EXECUTE("CREATE TABLE btZRSSReader ( bID INTEGER UNSIGNED NOT NULL, rss_url VARCHAR(255), rss_posts_size INTEGER UNSIGNED, rss_header VARCHAR UNSIGNED NOT NULL DEFAULT 'true', rss_titletag VARCHAR(255), rss_date VARCHAR UNSIGNED NOT NULL DEFAULT 'true', rss_content VARCHAR UNSIGNED NOT NULL DEFAULT 'true', rss_snippet VARCHAR UNSIGNED NOT NULL DEFAULT 'true', rss_showerror VARCHAR UNSIGNED NOT NULL DEFAULT 'true', rss_googleapi_key LONGTEXT, PRIMARY KEY (bID) )")
Nightmare, My first block and I am already ready to give up ;)
I have attached A screen shot of my MySQL Version and PHP stuff if that helps
This problem is that you are using UNSIGNED against fields with non numeric types. UNSIGNED basically means the number cannot be negative, so if you have a field of type "C" (which translates to VARCHAR), it makes no sense to include the UNSIGNED attribute. So you need to delete that tag from any non numeric fields you have.
Jon
Jon
Try this:
<?xml version="1.0"?> <schema version="0.3"> <table name="btZRSSReader"> <field name="bID" type="I"> <key /> <unsigned /> </field> <field name="rss_url" type="C" size="255"> </field> <field name="rss_posts_limit" type="I"> <unsigned /> </field> <field name="rss_header" type="C"> <notnull /> <default value="true" />
Viewing 15 lines of 38 lines. View entire code block.
Hi Mate
Thanks so much but it is still error-ing with the following error:
The following errors occurred when attempting to process your request:
mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL DEFAULT 'true', rss_titletag VARCHAR(255), rss_date ' at line 5] in EXECUTE("CREATE TABLE btZRSSReader ( bID INTEGER UNSIGNED NOT NULL, rss_url VARCHAR(255), rss_posts_limit INTEGER UNSIGNED, rss_header VARCHAR NOT NULL DEFAULT 'true', rss_titletag VARCHAR(255), rss_date VARCHAR NOT NULL DEFAULT 'true', rss_content VARCHAR NOT NULL DEFAULT 'true', rss_snippet VARCHAR NOT NULL DEFAULT 'true', rss_showerror VARCHAR NOT NULL DEFAULT 'true', rss_googleapi_key LONGTEXT, PRIMARY KEY (bID) )")
THanks for your help thus far would it help If i sent you the complete package?
Cheers
Justin
Thanks so much but it is still error-ing with the following error:
The following errors occurred when attempting to process your request:
mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL DEFAULT 'true', rss_titletag VARCHAR(255), rss_date ' at line 5] in EXECUTE("CREATE TABLE btZRSSReader ( bID INTEGER UNSIGNED NOT NULL, rss_url VARCHAR(255), rss_posts_limit INTEGER UNSIGNED, rss_header VARCHAR NOT NULL DEFAULT 'true', rss_titletag VARCHAR(255), rss_date VARCHAR NOT NULL DEFAULT 'true', rss_content VARCHAR NOT NULL DEFAULT 'true', rss_snippet VARCHAR NOT NULL DEFAULT 'true', rss_showerror VARCHAR NOT NULL DEFAULT 'true', rss_googleapi_key LONGTEXT, PRIMARY KEY (bID) )")
THanks for your help thus far would it help If i sent you the complete package?
Cheers
Justin
Sorry, my bad for not testing before I posted!
You also need to specify a size attribute for all "C" fields - so <field name="rss_header" type="C" size="255"><notnull /> etc...
Max size for "C" is 255...
Tested that and it worked, so should be all good...
Jon
You also need to specify a size attribute for all "C" fields - so <field name="rss_header" type="C" size="255"><notnull /> etc...
Max size for "C" is 255...
Tested that and it worked, so should be all good...
Jon
Dude you rock!
More Badges for Jon! its installed got more errors but these ones I will work through.
Thanks so much really appreciate it
Cheers
Justin
More Badges for Jon! its installed got more errors but these ones I will work through.
Thanks so much really appreciate it
Cheers
Justin
Glad I could help :)
Where there is no data, I close my tags like this:-
<key />
<unsigned />
<field attribute="yada" />
But looking at the script, you name a field "limit", I'm not certain but think that could be a MySQL reserved word. Try changing that field name.