GJSNeptune
[H]F Junkie
- Joined
- Mar 31, 2004
- Messages
- 12,372
It's kicking my butt. I've Googled endlessly for tutorials and examples, but implementing the different steps/parts with my existing queries is hopeless.
Here's my working query that brings up a writing piece (in this case nonfiction) after a variable is passed through a URL from an earlier query.
I don't want something overly complicated, but the simpler pagination walkthroughs seem to have more than one database query, and I'm struggling to figure out how to work my working query into them.
http://www.php-mysql-tutorial.com/php-mysql-paging.php (I like this one)
http://php.about.com/od/phpwithmysql/ss/php_pagination.htm
http://www.vipercreations.com/tutorials/PHP/19.html
Does anyone have a good guide?
Here's my working query that brings up a writing piece (in this case nonfiction) after a variable is passed through a URL from an earlier query.
Code:
<?php
import_request_variables('G', 'url_');
if ((isset($_GET[piece])) && ($_GET[piece] != "")) {
require("db/config.php");
require("db/opendb.php");
$query = "SELECT text, title, year FROM nonfiction WHERE id=". mysql_escape_string($_GET[piece]);
$result = mysql_query($query);
$content = mysql_fetch_assoc($result);
require("db/closedb.php");
echo "<h3>$content[title]</h3><br />";
echo "<p>$content[text]</p><br />";
echo "<span class=\"textcopy\">© $content[year]</span> <span class=\"courier\">FridayRain</span>";
} else {
echo "<span class=\"choose\">Please choose a title.<br /><br /><br /><br /><br /><br /><br /></span>";
}
?>
I don't want something overly complicated, but the simpler pagination walkthroughs seem to have more than one database query, and I'm struggling to figure out how to work my working query into them.
http://www.php-mysql-tutorial.com/php-mysql-paging.php (I like this one)
http://php.about.com/od/phpwithmysql/ss/php_pagination.htm
http://www.vipercreations.com/tutorials/PHP/19.html
Does anyone have a good guide?