Community Support for OpenDocMan (Deprecated)

Full Version: SQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey there

I have installed your script onto a new server (had it working on a previous server) and when you try and log in; it comes up with an error

Installed:
<!-- m --><a class="postlink" href="http://cbcuk.org/transcripts/">http://cbcuk.org/transcripts/</a><!-- m -->

Error: Error in query: SELECT web105-trans.odm_user.username FROM web105-trans.odm_user WHERE web105-trans.odm_user.id = 1You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-trans.odm_user WHERE web105-trans.odm_user.id = 1' at line 1

Any idea why this appears?

Thanks,
-Aaron
Dash in the database name.
Hey Steve

Thanks for the info; the host forces the dash - no way around this?

-Aaron
I was working on this issue as well. You can try getting some backticks in the database connection sting for the tablename and see if that helps.
Hi,

I have the same issue;

Error in query: SELECT 104628-database.odm_user.username FROM 104628-database.odm_user WHERE 104628-database.odm_user.id = 1You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '104628-database.odm_user WHERE 104628-database.odm_user.id = 1' at line 1

Since this is on a hosted server, I am not able to change the database name.

I tried your solution to insert back tick

/** The name of the database for [OpenDocMan */
define('DB_NAME', '`104628-database`');

But this does not seem to work, as it give me following result;

"Getting settings failed: No database selected"

Tried to add back tick in the DB_NAME in odm-init.php

$db = mysql_select_db(`DB_NAME`, $GLOBALS['connection']);

And get following;

Warning: shell_exec() has been disabled for security reasons in /storage/content/28/104628/database/public_html/opendocman/odm-init.php on line 33
Getting settings failed: No database selected

Did I misunderstand the work around with back ticks?

Regards,
Sebastian
I get exactly the same problem, dash in database name and unnable to rename the database.

Right after the initial login as admin (without passwd) an error message appears:
Error in query: SELECT vh6127-1db1.odm_user.username FROM vh6127-1db1.odm_user WHERE vh6127-1db1.odm_user.id = 1You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1db1.odm_user WHERE vh6127-1db1.odm_user.id = 1' at line 1

Is there a solution to this?
- Casper