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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
chrisbt
Dev Team Member
Dev Team Member
Posts: 204
Joined: Sun Sep 05, 2010 6:11 am

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

Post 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.
Last edited by chrisbt on Wed May 02, 2012 7:26 am, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

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

Post 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)
User avatar
chrisbt
Dev Team Member
Dev Team Member
Posts: 204
Joined: Sun Sep 05, 2010 6:11 am

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

Post 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.
Post Reply

Return to “CMSMS Core”