Blesta Addons Posted March 23, 2015 Report Posted March 23, 2015 Hello , first , i know that using hyphens "-" in a variable is not recommanded , we should use "_" instead . but for a porject i work for it, the client already has a big and tremendous data , and almost is impossible forit to change this , and we are forced to work the hyphens . i get a sql query error SQLSTATE[42000]: Syntax error or access violation: 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 '-`depends`='12346',`status`='active'' at line 1 on line ..... i have the fallowing code in a model $fields = array("package", "name", "version", "depends" , "pre-depends", "status" ); $this->Record->where("id", "=", $package_id)->update("packages", $vars, $fields); when i remove the "pre-depends" from the fields it work perfectly . i have tried "{pre-depends}" ; "pre\-depends" without success . how i can pass this without hacking he core record.php ?
LukesUbuntu Posted March 23, 2015 Report Posted March 23, 2015 Sorry remove this post, didn't read question properly.
Blesta Addons Posted March 24, 2015 Author Report Posted March 24, 2015 On 3/23/2015 at 3:24 AM, LukesUbuntu said: Sorry remove this post, didn't read question properly. anywhat was your response , thanks for take time to response
serge Posted March 24, 2015 Report Posted March 24, 2015 maybe you could include a variable conversion list like $original-variable1 = $variable1; $original-variable2 = $variable2; etc... in adition function like preg_replace(); can remove the dash from a given list, but it realy depend if you need something dynamic or just like above static list is enought
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now