need help with a limit query
Posted: Wed Aug 26, 2009 8:27 pm
Aight, with this design i got here i have 5 tiers, each tier needs to be in its own column so i used a table for that, the query is off a lil bit tho... each tier shows 11 records from the database....

here im starting from row 0(1) and showing 11 records.. this is the query for tier 1
this is tier 2's query... starting from row 12 and showing 11 records from database
tier 3 starting from row 22 and showing 11 records
tier 4.. starting from row 32 and showing 11 records
tier 5, starting from row 43 and showing 11 records
all is well in the tier one query, but as soon as i click on a tier 2, tier 3, tier 4, tier 5 item they all show the last record from tier one in the $_Get which was XML, so every tier after tier one is linking to XML...
and i realize this all needs to be pushed up into one function but i need to figure out how to get this working first....

here im starting from row 0(1) and showing 11 records.. this is the query for tier 1
Code: Select all
<?php
$query = mysql_query("SELECT * FROM cats LIMIT 0,11 ")
or die(mysql_error());
while($row = mysql_fetch_array( $query )) {
$job = $row['title'];
echo "<a href=\"jobs.php?jobtype=$job\">";
echo $row['title'];
echo "</a>";
echo"<Br/>";
}?>this is tier 2's query... starting from row 12 and showing 11 records from database
Code: Select all
<?php
$query = mysql_query("SELECT * FROM cats ORDER BY title LIMIT 12,11 ")
or die(mysql_error());
while($row = mysql_fetch_array( $query )) {
echo "<a href=\"jobs.php?jobtype=$job\">";
echo $row['title'];
echo "</a>";
echo"<Br/>";
}?>Code: Select all
<?php
$query = mysql_query("SELECT * FROM cats LIMIT 22,11 ")
or die(mysql_error());
while($row = mysql_fetch_array( $query )) {
echo "<a href=\"jobs.php?jobtype=$job\">";
echo $row['title'];
echo "</a>";
echo"<Br/>";
}?>tier 4.. starting from row 32 and showing 11 records
Code: Select all
<?php
$query = mysql_query("SELECT * FROM cats LIMIT 32,11 ")
or die(mysql_error());
while($row = mysql_fetch_array( $query )) {
echo "<a href=\"jobs.php?jobtype=$job\">";
echo $row['title'];
echo "</a>";
echo"<Br/>";
}?>tier 5, starting from row 43 and showing 11 records
Code: Select all
<?php
$query = mysql_query("SELECT * FROM cats LIMIT 43,11 ")
or die(mysql_error());
while($row = mysql_fetch_array( $query )) {
echo "<a href=\"jobs.php?jobtype=$job\">";
echo $row['title'];
echo "</a>";
echo"<Br/>";
}?>and i realize this all needs to be pushed up into one function but i need to figure out how to get this working first....