[ic] 001234 eq 1234 in [data] tag

Stefan Hornburg (Racke) racke at linuxia.de
Mon May 14 12:27:50 UTC 2012


On 05/14/2012 01:55 PM, Grant wrote:
>>>> I just noticed that this returns the title of SKU 1234:
>>>>
>>>> [data table=products key=|001234| field=title]
>>>>
>>>> Is this inherited from mysql or is it IC behavior?
>>>>
>>>> - Grant
>>>
>>>
>>> This is especially problematic because the following produces nothing,
>>> which is inconsistent with the above:
>>>
>>> [loop
>>> search="fi=products/ml=1/st=db/sf=sku/se=001234/op=eq/nu=0"][loop-data
>>> products title][/loop]
>>>
>>> - Grant
>>
>>
>> Which type is your sku column in products? varchar or int?
>>
>> Regards
>>         Racke
>
> I have this:
>
> Database products COLUMN_DEF "sku=INT(6) AUTO_INCREMENT PRIMARY KEY"
>
> Am I seeing this behavior because of INT?  Is VARCHAR ok to use with
> AUTO_INCREMENT?
>

Yes, as the number 001234 is equal to the number 1234. The string
001234 is different to 1234. I don't think you can use VARCHAR as
AUTO_INCREMENT column.

I would just make sure that requests to 001234 is either rejected (404)
or redirected to 1234 (301).

Regards
	Racke

-- 
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team




More information about the interchange-users mailing list