Hi,
I can't create the table notepad_notes (didn't get installed when activiating the module). First I thought it was a missing ',' after 'node_id int( 10 ) NOT NULL default '0' ', but after correcting that I still get the next message :
SQL-query:
CREATE TABLE {notepad_nodes}(
nid int( 10 ) NOT NULL default '0',
node_id int( 10 ) NOT NULL default '0',
node_type varchar( 32 ) NOT NULL ,
uid int( 11 ) NOT NULL DEFAULT '0',
KEY notepad_nodes( nid, node_id, uid )
) TYPE = MYISAM
MySQL retourneerde: Documentatie
#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 '{notepad_nodes} (
nid int(10) NOT NULL default '0',
' at line 1
Could you advise me how to create this table?
Kind regards,
Sjaak Terwindt
Comments
Comment #1
jondoesdrupal commentedHi Sjaak,
Not sure what the problem is there, it looks fine. For now though if you run the following statement in phpmyadmin or through a mysql session, then that should create the table for you (let me know if you need any assistance with doing that).
I've just tested this with my setup and it's worked, so should be ok for you.
Cheers,
Jon
Comment #2
jondoesdrupal commentedAhhh, I see what you mean now that I've re-read it. That error you got when you tried to run the code yourself rather than when you activated the module, right?
When we write queries with a drupal module, the table names are given curly brackets because drupal will check / modify the query before running it. If you want to run any of the queries directly you need to remove them as they're not valid sql.
Still, it's strange that one table was created successfully and not the other, did you get any errors in your drupal logs?
Comment #3
sjaakter commentedHi Jon,
Thanks for the quick response. It work fine without the brackets. I should have know that. In the logs I found some error message concerning the create table notepad_notes table. It failed. I think it failed because of the missing ',' in de install.php. I'm not sure.
This is the log message
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 'node_type varchar(32) NOT NULL, uid int(11) NOT NULL DEFAULT ' at line 4 query: CREATE TABLE notepad_nodes ( nid int(10) NOT NULL default '0', node_id int(10) NOT NULL default '0' node_type varchar(32) NOT NULL, uid int(11) NOT NULL DEFAULT '0', KEY notepad_nodes (nid, node_id, uid) ) TYPE=MyISAM; in /home/sterwind/public_html/drpl5/includes/database.mysql.inc op regel 172.
and this is the contents of the install.php as dowloaded 10-06 from drupal.org.
db_query("CREATE TABLE {notepad_nodes} (
nid int(10) NOT NULL default '0',
node_id int(10) NOT NULL default '0'
node_type varchar(32) NOT NULL,
uid int(11) NOT NULL DEFAULT '0',
KEY notepad_nodes (nid, node_id, uid)
) TYPE=MyISAM;");
After the 3 line there is a ',' missing.
Thanks for your support,
Sjaak.
Comment #4
sjaakter commentedI mentioned in the former post 'install.php'. This is not correct. It was the 'notepad.install' script.
Sjaak.
Comment #5
jondoesdrupal commentedHi Sjaak, now you mention it I seem to recall I spotted that before but completely forgot about it when I went to commit the last changes.
I'll update that and get a new release out when I get home tonight.
Cheers,
Jon
Comment #6
jondoesdrupal commentedFixed in 5.x-1.2, thanks for the bug report.
Comment #7
(not verified) commented