christophermaeuer Posted August 13, 2014 Report Posted August 13, 2014 Hello together, I a trying to build a SQL query: SELECT * FROM `newsletters_settings` WHERE `newsletters_settings`.`key` = 'plugin_id'; Therefor I use this code: $return = $this->Record-> select()-> from("newsletters_settings")-> where("newsletters_settings.key", "=", "plugin_id")-> fetch(); But the result is null, and a var_dump shows the following: object(PDOStatement)#97 (1) { ["queryString"]=> string(75) "SELECT * FROM `newsletters_settings` WHERE `newsletters_settings`.`key` = ?" } What am I doing wrong? Thanks in advance, Christopher
christophermaeuer Posted August 13, 2014 Author Report Posted August 13, 2014 Okay, problem fixed: The questionmark appeared because I already called fetch() and the result was null because I had to call fetchAll(). Thank you
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now