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,


Messages In This Thread
[Database] Active Record produces database query errors - by El Forum - 12-30-2008, 05:05 PM
[Database] Active Record produces database query errors - by El Forum - 12-30-2008, 05:10 PM
[Database] Active Record produces database query errors - by El Forum - 12-30-2008, 05:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB