You are here:  » Remove Empty Field

Support Forum



Remove Empty Field

Submitted by cq on Sat, 2009-06-13 11:10 in

Hi David,

After import the feed, in drop down navigation for brand, there is an empty field. How do I remove the empty field. I tried using filter but it doesn't work.

Hope you can help.

thanks
jack

Submitted by support on Sat, 2009-06-13 11:24

Hi,

Assuming that you're using the code (or something very similar) from this thread, replace the existing SQL to select the brands:

  $sql = "SELECT DISTINCT(brand) as brand FROM `".$config_databaseTablePrefix."products` ORDER BY brand";

...with:

  $sql = "SELECT DISTINCT(brand) as brand FROM `".$config_databaseTablePrefix."products` WHERE brand <> '' ORDER BY brand";

That will exclude the empty option from the list.

Cheers,
David.

Submitted by cq on Sat, 2009-06-13 12:24

Hi David

Yeap. It works now.

Many thanks

Cheers,
Jack