Hi all,
I found wonderfull script here on thread: thread434-1489969
and the code is:
But I need that result is not sorted like:
result1 result2 result3
result4 result5 result6
But like this:
result1 result3 result5
result2 result4 result6
Is it possible to achieve this using the above script?
Thanx!
I found wonderfull script here on thread: thread434-1489969
and the code is:
Code:
<?php
$columns = 4;
$sql = "Select id, imgName, imgDescription from imageTable";
//perform the query
$result = mysql_query($sql) or die(mysql_error());
//prepare the css
$column_css = (100/$columns) - 1;
$css = <<<HTML
<style>
.contentHolder {width:85%; margin: 0 auto; text-align:center;}
.innerHolder {width: $column_css; margin-right: 1px; float:left;}
.clear {line-height: 0.5px; visibility: hidden; clear:both;}
}
</style>
HTML;
//prepare the output
$output = <<<HTML
<div id="contentHolder">
HTML;
//iterate the recordset
while ($row = mysql_fetch_assoc($result)){
$output .= <<<HTML
<div class="innerHolder">
<div class="imageHolder">
<img src="images/{$row['imgName']}"
alt="{$row['imgDescription']}"
title="{$row['imgDescription']}" />
</div>
<div class="captionHolder">
{$row['imgDescription']}
</div>
</div>
HTML;
}
//finish the output
$output .= <<<HTML
<div class="clear"> </div><!--- clear the floats for box model issues --->
</div> <!--- finish the contentHolder div --->
HTML;
?>
But I need that result is not sorted like:
result1 result2 result3
result4 result5 result6
But like this:
result1 result3 result5
result2 result4 result6
Is it possible to achieve this using the above script?
Thanx!