Hi everyone, I am new to php. I am using a piece of code which is
testing if a certain variable is <=0. and the code is written as
follows:
$lc_align = 'center';
if ($listing['products_quantity']<=0) {
$lc_text = tep_image_button('button_buy_now_na.gif',
IMAGE_BUTTON_BUY_NOW_NA) . ' ';
} else {
$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF),
tep_get_all_get_params(array('action')) .
'action=buy_now&products_id=' . $listing['products_id']) . '">' .
tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) .
'</a> ';
}
break;
}
The problem I am facing is that the this code returns all result to be
true ie. <=0 even though most of the variable are greater than 1. Is
the test wrong?
Or can I change the syntax and how do I do that
Any suggestion are welcomed.
Thanks