avibitton Posted July 15, 2012 Share Posted July 15, 2012 Hi im having trouble in combining php with javascript , in short what i need to do if the mobile in 90 degrees(which is wider), so show div with 4 columns ,else(normal orientation) show 3 columns. i dont know how to use both of javascript orientation detection and php which execute the columns. thats the code which shows the columns : <?php $stmt = $db->query('SELECT * FROM rooms'); $count = $db->fetchOne( 'SELECT COUNT(name) AS count FROM rooms' ); for ( $ro = 0; $ro <$count/4; $ro++ ) { echo '<div id="rom_wrap">'; for ( $column = 0; $column < 4; $column++ ) { /*while ($row = $stmt->fetch()) {*/ $row = $stmt->fetch() ; echo '<div class="naming" id="naming"><img src="'.$row['image'].'" id="imaging"></br>'.$row['name'].'</div>'; } echo '</div>'; echo '<br />'; } ?> Link to comment https://forums.phpfreaks.com/topic/265695-changing-number-of-columns-according-to-mobile-dectection-orientation/ Share on other sites More sharing options...
Pikachu2000 Posted July 15, 2012 Share Posted July 15, 2012 Do you have a question? Link to comment https://forums.phpfreaks.com/topic/265695-changing-number-of-columns-according-to-mobile-dectection-orientation/#findComment-1361652 Share on other sites More sharing options...
avibitton Posted July 15, 2012 Author Share Posted July 15, 2012 if i wrote that i dont know how to do it so it a quastion . i need to know how (?) i can use mobile orientation and according to the orientation, display for example 5 icons to the width of 90 degrees(sided) , and in normal orientatiion to display 4 icons cause it less wide . the display of the icons of course its for loop from the database . thx avi. Link to comment https://forums.phpfreaks.com/topic/265695-changing-number-of-columns-according-to-mobile-dectection-orientation/#findComment-1361657 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.