Hi I am using a small cgi program to open a flat data file then go through the results and display only results that are between two values in a field.
I have pasted the part of the script that I am using to do this below:
The field I am trying to use tha value of is $price, my problem is that it works fine for 2 digit numbers, if $price is 20 and I set the values in my program to 1 and 30 I get the results I want, howeber I need to do this using upto 6 digit numbers in $price.. if I currently change my values in the search program to 1 & 201, it gives me incorrect results as I think it is only looking at the first 2 digits of the number. Can anyone assist please I am a novice with this and am OK at cutting and pasting to get scripts to work but thats about as far as it goes.
Thanks Rob
Here is the snipet of code that looks at the value of price then prints the results dependant on the value:
foreach $data (@data) {
($id,$simage,$bimage,$Category,$itemcode,$price,$Sex,$Size,$new,$Description,) = split(/::/, $data);
if (($price gt 1) && ($price lt 200)) {
$a++;
if ($a <= $line) {
next;
}
else {
$i++;$j++;
if ($j <= 9) {
if ($i==1) {
print "<tr>";
}
I have pasted the part of the script that I am using to do this below:
The field I am trying to use tha value of is $price, my problem is that it works fine for 2 digit numbers, if $price is 20 and I set the values in my program to 1 and 30 I get the results I want, howeber I need to do this using upto 6 digit numbers in $price.. if I currently change my values in the search program to 1 & 201, it gives me incorrect results as I think it is only looking at the first 2 digits of the number. Can anyone assist please I am a novice with this and am OK at cutting and pasting to get scripts to work but thats about as far as it goes.
Thanks Rob
Here is the snipet of code that looks at the value of price then prints the results dependant on the value:
foreach $data (@data) {
($id,$simage,$bimage,$Category,$itemcode,$price,$Sex,$Size,$new,$Description,) = split(/::/, $data);
if (($price gt 1) && ($price lt 200)) {
$a++;
if ($a <= $line) {
next;
}
else {
$i++;$j++;
if ($j <= 9) {
if ($i==1) {
print "<tr>";
}