Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

PolarBair

macrumors newbie
Original poster
Jun 8, 2005
1
0
I'm getting an error when I try to install phpBB2 on my website. The error is:

An error occurred trying to update the database
You have an error in your SQL syntax near '-_auth_access ( group_id mediumint(8) DEFAULT '0' NOT NULL, forum_id small' at line 10

Any one have any idea how to fix this?
 
has it only happened once? if so then just delete the database and re-download phpbb2 and then start over.

or you can ask someone else to do it for you.
 
If its having trouble writing to the database maybe the username doesn't have sufficient rights.
 
PolarBair said:
I'm getting an error when I try to install phpBB2 on my website. The error is:

An error occurred trying to update the database
You have an error in your SQL syntax near '-_auth_access ( group_id mediumint(8) DEFAULT '0' NOT NULL, forum_id small' at line 10

What did you enter for the table prefix value in the installation procedure? If you can't remember, look at $table_prefix in config.php (root directory of phpBB). From that error message it looks like the value contains a dash (-) which isn't a valid value for a database table name, _ is allowed but not -.
 
Knox said:
What did you enter for the table prefix value in the installation procedure? If you can't remember, look at $table_prefix in config.php (root directory of phpBB). From that error message it looks like the value contains a dash (-) which isn't a valid value for a database table name, _ is allowed but not -.
You can use a dash in the name of a MySQL table, it's not an illegal character. I've used them myself with no problems.

http://dev.mysql.com/doc/mysql/en/legal-names.html

PolarBair, I'm not sure what the error message means without seeing the full statement that caused the problem. You may want to try posting this in the phpBB support forum instead.
 
MontyZ said:
You can use a dash in the name of a MySQL table, it's not an illegal character. I've used them myself with no problems.

Ah, so you can, but only if you do `table-name` I think, which I don't believe phpBB does.

"An identifier may be quoted or unquoted. If an identifier is a reserved word or contains special characters, you must quote it whenever you refer to it. For a list of reserved words, see Section 9.6, “Treatment of Reserved Words in MySQL”. Special characters are those outside the set of alphanumeric characters from the current character set, '_', and '$'."

mysql> create table test-test (id int);
ERROR 1064: You have an error in your SQL syntax near '-test (id int)' at line 1
mysql> create table `test-test` (id int);
Query OK, 0 rows affected (0.00 sec)
 
Yes, the backticks are needed around the table name. I always use the backticks in my code, especially if you are going to allow the user to control table names. phpBB probably didn't do this, and that's probably what's causing the error.

Good eyes! :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.