barney0o0 Posted October 27, 2008 Share Posted October 27, 2008 Hi Chaps I have repeat div that i need a conditional display. So, show if the pagecontent.subid doesnt equal 5, but also, dont show if the id doesnt equal 5 and the recordset 'extras' results are empty What ive used so far is <?php do { ?> <?php if ($row_pagecontent['subid'] != '5' || ($row_pagecontent['subid'] != '5' && mysql_num_rows($extras) > 0)): ?> How if the results for extras is empty it is still showing... any ideas?, thanks in advance Quote Link to comment Share on other sites More sharing options...
n3ightjay Posted October 27, 2008 Share Posted October 27, 2008 <?php if ($row_pagecontent['subid'] != '5' || ($row_pagecontent['subid'] != '5' && mysql_num_rows($extras) > 0)): ?> the div will always show if the pagecontent.subid != 5 because of the or(||) operator you will always have a logical truth. try this: <?php if ($row_pagecontent['subid'] != '5' && mysql_num_rows($extras) > 0): ?> Quote Link to comment Share on other sites More sharing options...
barney0o0 Posted October 27, 2008 Author Share Posted October 27, 2008 thanks...it works fine.... I just couldnt get my head around the correct logic, even after spending 3 hours on it! many thanks Quote Link to comment Share on other sites More sharing options...
n3ightjay Posted October 27, 2008 Share Posted October 27, 2008 your welcome ... been there many times Quote Link to comment 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.