Welcome Guest, Not a member yet? Register   Sign In
Very strange database result

I have a code that fetches settings from the DB but instead of returning a value it returns key name.

The code:

PHP Code:
public function getValue($key){
       $CI =& get_instance();
       $query $CI->db->query('SELECT ? FROM settings', array($key));
       //return $row[$key];
The output:

array(1) { ["max_problems_in_selector"]=> string(24) "max_problems_in_selector" }

The table:

So what $key are you specifying?

Use last_query() to check that you are getting a correct SQL query. Run that one in phpmyadmin and see if that give you the correct results.

Theme © iAndrew 2016 - Forum software by © MyBB