Page 1 of 1

[solved] SQL / ADODB lite Help for Dummies (Dummy actually!)

Posted: Tue May 01, 2012 9:08 pm
by chrisbt
When I put a '<' less than operator in my where clause it gets converted to a '<' before the query is executed.

Code: Select all

$sql = "SELECT p.id FROM cms_module_products AS p WHERE p.weight<'100'";
$res = $db->GetCol($sql);

The debug output shows:

Code: Select all

SELECT p.id FROM cms_module_products AS p WHERE p.weight<'100'
I'm sure there is a nice easy way to solve this I just can't find it.

Thanks. Chris.

Re: SQL / ADODB lite Help for Dummies (Dummy actually!)

Posted: Tue May 01, 2012 11:17 pm
by Jos
You mean you see this in the cmsms debug mode?

I'm pretty sure that it's just a display issue. The query will be executed with <

The GetCol function I'm not familiar with. Are you sure it is a adodb lite command?

I know these are:
$db->Execute($sql, [$inputarray])
$db->GetAll($sql)
$db->GetArray($sql)

Re: SQL / ADODB lite Help for Dummies (Dummy actually!)

Posted: Wed May 02, 2012 7:26 am
by chrisbt
Thanks Jos. Yes the output in was in CMSMS debug mode.

GetCol did seem to work even though it's not listed in the adodb lite functions. I'll swap to one of the other functions to try to get my query functioning as required.