hi,
i need help on my array code. what i want is to show 6 results into the the number i indicated but it doesn't seem to work.
the result i want is something like this:
result 1 result 2 result 3
result 4 result 5 result 6
below is my code:
<?php
$query = mysql_query("SELECT filename, title FROM jos_phocagallery WHERE published=1 ORDER BY RAND() LIMIT 6") or die(mysql_error());;
$row = mysql_fetch_array( $query );
$filename[] = $row["filename"];
$title[] = $row["title"];
?>
<p>
<img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[0]; ?>" alt="<?php echo $title[0]; ?>" title="<?php echo $title[0]; ?>" border="0" />
<span class="demo-sep"> </span>
<img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[1]; ?>" alt="<?php echo $title[1]; ?>" title="<?php echo $title[1]; ?>" border="0" />
<span class="demo-sep"> </span>
<img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[2]; ?>" alt="<?php echo $title[2]; ?>" title="<?php echo $title[2]; ?>" border="0" />
</p>
<p>
<img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[3]; ?>" alt="<?php echo $title[3]; ?>" title="<?php echo $title[3]; ?>" border="0" /><span class="demo-sep"> </span>
<img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[4]; ?>" alt="<?php echo $title[4]; ?>" title="<?php echo $title[4]; ?>" border="0" /><span class="demo-sep"> </span>
<img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[5]; ?>" alt="<?php echo $title[5]; ?>" title="<?php echo $title[5]; ?>" border="0" />
</p>
hope you could help me with this.
thanks!