query results to separate pages (by ID)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mikegotnaild
Forum Contributor
Posts: 173
Joined: Sat Feb 14, 2004 5:59 pm

query results to separate pages (by ID)

Post by mikegotnaild »

I'm new to php so keep that in mind :). I would like to separate query results into separate pages by the ID. .. For example. http://naild.com/localmm/modules.php?na ... andpage=$p Where $p would be the ID number for the row to be viewed and it will take me to a page that echos something like this.

Code: Select all

<?
$i=0;
while ($i < $num) {

$bandname=mysql_result($result,$i,"band_name");
$description=mysql_result($result,$i,"description");
$history=mysql_result($result,$i,"history");
$influences=mysql_result($result,$i,"influences");
$genra=mysql_result($result,$i,"genra");
$email=mysql_result($result,$i,"email");
$website=mysql_result($result,$i,"website");
$mp3file=mysql_result($result,$i,"mp3file");
$imagefile=mysql_result($result,$i,"imagefile");

echo "<img align=right src="http://naild.com/localmm/upload/$imagefile"><br><b>$bandname</b><br><br><b>Description:</b> $description<br><br><b>History:</b> $history<br><br><b>Influences:</b> $influences<br><br><b>E-mail:</b> $email<br><br><b>Website:</b> <a href="$website">$website</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <b>Mp3: <a href="http://naild.com/localmm/upload/$mp3file">$mp3file</a><hr><br>";

++$i;
}
?>
Could someone point me in the right direction to accomplish this? Up until now ive been reading tutorials on how to do certain things that i need to accomplish on my website. This is just about the last major thing i need to do on my site and im very anxious to get it done. :)
evilMind
Forum Contributor
Posts: 145
Joined: Fri Sep 19, 2003 10:09 am
Location: Earth

Post by evilMind »

Check out qads Code Snippet see if that will work for you:
http://www.devnetwork.net/forums/viewtopic.php?t=18466
mikegotnaild
Forum Contributor
Posts: 173
Joined: Sat Feb 14, 2004 5:59 pm

Post by mikegotnaild »

thanks
Post Reply