Is there any way to use the php next and prev commands to create these buttons?
I tried to create an array and set the current value to the current title_id but it kept coming out as '1'. How do you set the pointer to start at a specific value in the array? I want to display the next and prev images based on the titles sorted alphabetically. The ids are not in order. I thought if the array were sorted by title, the next and prev commands would do what I wanted, but it didn't work. Any ideas?
Code:
$sql4 = "SELECT title_id, title FROM `title` WHERE `artist_id` = $artist_id AND `on` = 1 ORDER BY `title`";
$result4 = mysql_query($sql4,$connection) or die("Couldn't execute $sql4 query. <br> mysql error: ".mysql_error());
$row = mysql_fetch_array($result4);
$art['title_id'] = current($row);
This is the code snippet that is behind the Previous button... which doesn't work.
Code:
?title_id=<?php echo prev($row);?>
Thanks for any help.
Bookmarks