I am a beginner in PHP and I have the following problem: site for movies with categories: comedy, horror, action and so on... the code for displaying the results is the same for all of the genres and I make the following:
$index = (preg_match("//", $_GET['category'])) ? $_GET['category'] : 0;
$sql = "SELECT * FROM movies WHERE category = '$index' ORDER BY movID DESC";
It's okay so far BUT... for every genre, I have and pagination, and when try to go the next page, consider page 2 for genre comedy just nothing... I can't explain exactly... I just want to ask you some advise how to reuse the same code for all genres, and the pagination to work properly, some good tutorial or something else... if somebody is interesting in that I can show him the code... the site I am making is just for my personal training...
PS: My english is nor very good, sorry about that please in the beginning of your answer rate my level of english(1-10) thanks