I should be posting in "Newbies" section but as I am no programmer and wouldn't become it, I dare to post here :rolleyes:
I run a joke site and want to add functionality. Wrote a script but it doesn't work.
The basic idea is to create a small navigation script which would allow a user to move from a joke to the next joke with a single click:
<?php
$sql = "select jokeid from jokes where jokeid>$jokeid and catid=$catid order by jokeid limit 1";
$result = mysql_query($sql ,$db);
if ($myrow = mysql_fetch_array($result)) {
printf("<a href='joke.php?jokeid=<?php printf($jokeid); ?>' >Next Joke</a>");
} while ($myrow = mysql_fetch_array($result));
?>
There's a table called 'jokes' in my database and the script had to move from ID to ID while the next ID's value is higher.
Please do not criticize 'printf'. I am a management student not programmer. Any ideas or suggestions would be highly appreciated! Thanks.