Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


SQL Syntax error

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin Development
Author Message
melchandra
Cacti User


Joined: 29 Jun 2004
Posts: 312
Location: Indiana

PostPosted: Thu Oct 18, 2007 1:56 pm    Post subject: SQL Syntax error Reply with quote

I discovered an error while testing the new version of Cacti, I copied my sql database to "cacti-devel". Unfortunately this caused a number of plugins to break, I traced the problem down the the following line of code located in the setup.php files in the various plugin directories:

$sql = "show tables from " . $database_default;

The table is not properly quoted, I think it should look like:

$sql = "show tables from `" . $database_default . "`";

Notice the back-ticks that escape the database name. This is important because the hyphen I put in my dB name caused several problems with a couple of differant plugins that called this code.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin Development All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group