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];
} 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.