Hello guys. Just an example of what I'm talking about, I made a page to show you guys what Im looking for here : http://netroxy.com/51274581336/tablehelp.htm


If anybody can build a script that would do search results for certain categories of games, such as skill games, action games, adventure games, shooter games and display them as search results directly from a mysql database.

Id like to search a specific type of game from my mysql database from the fldCategory column, like Skill games. When the specific game category has been searched, it then displays Image of the game (fldIconMedium) and the title of the game (fldTitle) from the table. So the category ID in the URL would be 'http://www.blabla.com/gameslist.php?cat=skills'. If it was action games being searched for, then it would be 'http://www.blabla.com/gameslist.php?cat=action'. For Mind games its 'php?cat=mind', adventure is 'php?cat=adventure' Notice the 'cat' for category in the URL. I want the results displayed in a table like the one showed in the page I made above. It shows how many results for skills have been found, under it showing 15 results per page view, and the bottom shows numbers from 1 to 10 as an example of how many 'skill' games have been found so the user can click them to look at the rest of the skill games.

SELECT * FROM table WHERE fldCategory = "$_GET['cat']"

script for paging to show 1 to 10 at bottom of the page....

check.php

<?php
$page=1;
$nor=10;
$a=1;
if(isset($_GET['page']))
{
}
else
{
$_GET['page']=1;
}
echo $_GET['page'];
$con=mysql_connect("localhost","root","")
or die ("error");
$db=mysql_select_db("check",$con)
or die("database not found");
$result=mysql_query("SELECT * FROM comment")
or die ("query error");
echo "<table border='1'><tr><th>name</th><th>Comment</th></tr>";
$r=mysql_num_rows($result);
echo $r."<br/>";
$p=ceil($r/$nor);
//echo $p;
while($rows=mysql_fetch_array($result))
{
if($a>($_GET['page']-1)*$nor)
{
echo "<tr><td>".$rows['user']."</td><td>".$rows['comment']."</td></tr>";
}
$a=$a+1;
}
echo "</table>";
for($i=1;$i<=$p;$i++)
{
if($i==$_GET['page'])
{
echo $i;
}
else
{
echo "<a href='check.php?page=".$i."'>".$i."</a>";
}
}
 
?>

Thanks I'll work around it and reply you to see whats going on. :)

Sorry I forgot to mention the Next and Previous buttons for the buttons from 1 to 10. I did look at your code and I was wondering if the script you wrote is for just links from 1 to 10? If you'd like an example of what I mean, you can visit www.games68.com and you can click on one of the game categories in the site, and at the bottom you'll see how the numbers gradually increase after fetching how many games have been found for a the particular category. I don't think its necessarily from 1 to 10, but it automatically increases or decreases in number depending how many games have been found for the particular category.

The code i gave is to count the number of records in each page and then show the links below to go to n number of pages ...
Sorry in my script i forgot to change that u want 15 records per page...so for it..just change in my code...

$nor=10;

to

$nor=15;

Now as per arranging these records in 3 per row ,use <div> and a counter to count three records if it is greater than 3 than place the record in next row...
Hopefully i m clear....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.