I'm pretty good at php and mysql, it's been sometime now that i was trying to find a way to output result, more then 1 at a time, so i came up with this function
[PHP] function screenshots()
{
global $website_link;
$name1 = $_GET['name'];
$name= str_replace("-", " ", $name1);
$query = @mysql_query("SELECT * FROM `games` WHERE `name` = \"$name\" LIMIT 1");
$id= @mysql_result($query, 0, "id");
$categorie= @mysql_result($query, 0, "categorie");
$categorie1= str_replace(" ", "-", $categorie);
$query = @mysql_query("SELECT * FROM `screenshots` WHERE `gameid` = \"$id\"");
$screenshots= @mysql_numrows($query);
echo "<table>
<tr width=\"100%\"><td>
<a href=\"$website_link/games/$name1.html\">$name</a>
-
<a href=\"$website_link/cheats/$name1.html\">Cheats</a>
-
<a href=\"$website_link/screenshot/$name1.html\">Screenshot</a>
-
<a href=\"$website_link/downloads/$name1.html\">Downloads</a>
</td>
</tr>
<tr width=\"100%\">
<td><a href=\"$website_link/categories/$categorie1.html\">$categorie</a> > <a href=\"$website_link/games/$name1.html\">$name</a> > Screenshots</td></tr></table>";
if(empty($screenshots))
{
echo "No Screenshots Available";
}
$i = 0;
echo"<table width=\"100%\">";
for ($i=0; $i<$screenshots; $i++)
{
$id = mysql_result($query, $i, "id");
$gameid = mysql_result($query, $i, "gameid");
$image= mysql_result($query, $i, "image");
$comment = mysql_result($query, $i, "comment");
$name = mysql_result($query, $i, "name");
$b = 2;
$c= $i/$b;
if(!strrchr($c, "."))
{
echo"
<tr align=\"center\" width=\"50%\">
<td>
<a href=\"$image\"><img src=\"$image\" width=\"200\" height=\"200\" /></a>
<br />
$name
<br />
$comment
<br />
--------------------------------------
</td>";
}
else
{
echo" <td>
<a href=\"$image\"><img src=\"$image\" width=\"200\" height=\"200\" /></a>
<br />
$name
<br />
$comment
<br />
--------------------------------------
</td>
</tr>";
};
}
echo"</table>";
}
[/PHP]
this will output two images at a time, but what i want is for php to output 3 at a time, can anybody help me out