Jump to content

IF() statements not working correctly. help!


ipwnzphp

Recommended Posts

heehee

 

foreach ($vendors as $K => $V) {
if($vendors[$K]["vendLevel"] == "1") $vendor1[] = $vendors[$K]; //<--remove
if($vendors[$K]["vendLevel"] == "1") $vendor1[] = $vendors[$K];
if($vendors[$K]["vendLevel"] == "2") $vendor2[] = $vendors[$K];
if($vendors[$K]["vendLevel"] == "3") $vendor3[] = $vendors[$K];
if($vendors[$K]["vendLevel"] == "4") $vendor4[] = $vendors[$K];
} 

heehee

 

foreach ($vendors as $K => $V) {
if($vendors[$K]["vendLevel"] == "1") $vendor1[] = $vendors[$K]; //<--remove
if($vendors[$K]["vendLevel"] == "1") $vendor1[] = $vendors[$K];
if($vendors[$K]["vendLevel"] == "2") $vendor2[] = $vendors[$K];
if($vendors[$K]["vendLevel"] == "3") $vendor3[] = $vendors[$K];
if($vendors[$K]["vendLevel"] == "4") $vendor4[] = $vendors[$K];
} 

 

didnt fix it.

can you remove the print_r's

 

also the site looks ok..

 

whats wrong with it ? the doubles have gone (from what i can see)

 

It repeats the country like Anguilla shows up 2 times the levels are spoused to be the frist then under the countrys. The dobules are still there look now.

only think i can think of is change

unset($vendors);
$vendors = array_merge($vendor4, $vendor3, $vendor2, $vendor1);

 

to the way i said it should be

unset($vendors);
$vendors =array_merge($vendor2, $vendor1, $vendor3, $vendor4);

 

 

other than that i don't know what the problem is i see none

only think i can think of is change

unset($vendors);
$vendors = array_merge($vendor4, $vendor3, $vendor2, $vendor1);

 

to the way i said it should be

unset($vendors);
$vendors =array_merge($vendor2, $vendor1, $vendor3, $vendor4);

 

 

other than that i don't know what the problem is i see none

 

Nope that aint the issue. The levels should be seamless with the country's. it should only show the country once! not 2 times.

can you post an example of what it should look like compared to what it does look like..

 

 

i have a script that displays vendors and i have levels set in the database and i am trying to make level 2 show first than level 3 than level 4 than level 1.

 

personally i think this could be sorted via SQL statement!

can you post an example of what it should look like compared to what it does look like..

 

 

i have a script that displays vendors and i have levels set in the database and i am trying to make level 2 show first than level 3 than level 4 than level 1.

 

personally i think this could be sorted via SQL statement!

 

It should like this http://www.trixielugosi.com/code/hmm.jpg

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.