Hello All,
At the top of all "create XXX" pages (as in "create book pages" et cetera" I get an error message similar to the following:
user error: 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 'types LIKE '%page%' ORDER BY weight, name' at line 1
query: SELECT * FROM vocabulary WHERE types LIKE '%page%' ORDER BY weight, name in /var/www/html/drupal/includes/database.mysql.inc on line 69.
I'm using
Drupal 4.1.0
Apache 2.0.40-11.3
MySQL 4.1.0-alpha
php 4.2.2-8.0.7
I have set all php up as per the drupal installation guide, and have searched through the Drupal forums for a possible solution for the past several hours to no avail.
Any help would be appreciated.
Regards, Bawdo2001
Comments
reserved word
(i think) the query is failing because "types" is a reserved word in mysql 4. it wasn't in mysql 3 (there, it was "type").
fix: change "types" (and, to be sure, "type" also) to a both mysql 3 and 4 non reserved word such as "voc_type" in both code and database. see also the links mentioned here (search for "database naming schemes") for suggested database naming conventions. if we would use something like that (especially, prefix every db field with a short table name prefix a la "voc_type", "nod_type", etc), we wouldn't have problems like this. (besides, it would be possible to auto-generate nice ER-diagrams ...).
Re: Reserved word
Types is definately a reserved word.
I have renamed the field in the vocabulary table and changed all appropriate references to the former field name.
This has fixed the problem.
What to change