ipwnzphp Posted August 15, 2007 Author Share Posted August 15, 2007 can you update the http://www.trixielugosi.com/code/vendors.phps with your latest code please EDIT: you can remove the print_r's Done! Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-324511 Share on other sites More sharing options...
MadTechie Posted August 15, 2007 Share Posted August 15, 2007 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]; } Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-324515 Share on other sites More sharing options...
ipwnzphp Posted August 15, 2007 Author Share Posted August 15, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-324539 Share on other sites More sharing options...
MadTechie Posted August 15, 2007 Share Posted August 15, 2007 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) Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-324541 Share on other sites More sharing options...
ipwnzphp Posted August 15, 2007 Author Share Posted August 15, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-324542 Share on other sites More sharing options...
ipwnzphp Posted August 16, 2007 Author Share Posted August 16, 2007 Mad, Got anymore ideas? Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-325578 Share on other sites More sharing options...
MadTechie Posted August 16, 2007 Share Posted August 16, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-325651 Share on other sites More sharing options...
ipwnzphp Posted August 16, 2007 Author Share Posted August 16, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-325653 Share on other sites More sharing options...
MadTechie Posted August 16, 2007 Share Posted August 16, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-325664 Share on other sites More sharing options...
ipwnzphp Posted August 16, 2007 Author Share Posted August 16, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-325667 Share on other sites More sharing options...
MadTechie Posted August 16, 2007 Share Posted August 16, 2007 your page is doing that ? Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-325668 Share on other sites More sharing options...
ipwnzphp Posted August 16, 2007 Author Share Posted August 16, 2007 your page is doing that ? nope look. http://www.isledo.com/site/index.php?p=1&sp=7 Quote Link to comment https://forums.phpfreaks.com/topic/64816-if-statements-not-working-correctly-help/page/2/#findComment-325669 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.