$genre_id = $_GET['id'];
$items = ITEMS_PER_PAGE;
if(isset($_GET['page']))
{
$offset = $_GET['page'];
$offset *= $items;
$query = 'select * from artist where genre_id = '.mysql_real_escape_string($genre_id)." limit $offset,$items";
}
else
{
$query = 'select * from artist where genre_id = '.mysql_real_escape_string($genre_id);
}
$allArtists = mysql_query($query);
[code=php] tags, syntax highlighting
select * doesnt allow "us" to see the column names, Is there a column "name"
$items = // are you sure about this definition it doesnt look right
$items = $_GET['ITEMS_PER_PAGE']; // looks more usual to me
what is the exact error message
and where did you put the order by clause in this code
Last edited by almostbob; Mar 17th, 2009 at 11:08 am.
Reputation Points: 562
Solved Threads: 368
Posting Maven
Offline 2,970 posts
since Jan 2009