Welcome Guest, Not a member yet? Register   Sign In
[Database] Active Record produces database query errors
#1

[eluser]Unknown[/eluser]
Hey guys,

I'm totally stuck on the following code:

Code:
$this -> db -> where ('name', $name);
$query = $this -> db -> get ($this -> tables['members']);
                
if ($query -> num_rows()) return true;
else return false;

The problem is, that I get the following error:

Quote:A Database Error Occurred

Error Number: 1054

Unknown column 'DayBay' in 'where clause'

SELECT * FROM (`guild_members`) WHERE `name` = DayBay

In this case, the following variables contain the following data:
$name = 'DayBay'.
$this -> tables['members'] = 'guild_members'.

The problem with the query is, that it's not adding the additional ' marks before and after the value (In this case DayBay).

Am I doing something wrong, or is it a bug?

Cheers for helping,
#2

[eluser]Michael Wales[/eluser]
What version of MySQL / version of CodeIgniter?
#3

[eluser]Unknown[/eluser]
[quote author="Michael Wales" date="1230700230"]What version of MySQL / version of CodeIgniter?[/quote]

The lastest SVN version: Dump 1595.




Theme © iAndrew 2016 - Forum software by © MyBB