Jump to content

[SOLVED] Next page..


textbox

Recommended Posts

Hello all,

 

Right, I have the script that pulls out my bulletins title and author from the db.

I can limit that to whatever i want, say 8.

 

Hopefully, the database will be populated with loads of bulletins, id like to be able to limit the results to 8 per page and have a 'next page' text link that will pull out the next 9-17 results. If you know what I mean?

 

Any help would be great.

 

Here is my code so far!

 

<?php
	 //format a spacer for further down in the page, this is a local variable
				 $spacer = "    -    ";
                    
                 //get the bulletin information from the table
                     
$query = mysql_query("SELECT * FROM bulletin WHERE timeposted ORDER BY timeposted ASC LIMIT 6");
                  	if ($row = mysql_fetch_array($query)) {
						do {
							$timeposted = date("d F Y", strtotime($row["timeposted"]));
							$source 						= $row["source"];
							$message_after_match		 	= $row["message_after_match"];
							$messageid				 		= $row["messageid"];

							 $userquery = mysql_query("SELECT username FROM users WHERE source='$source'");
							 $user = mysql_result($userquery, 0, "username"); 

							//this section prints out the variables needed on the page
							print "<tr>
					<td><div align='left'>Written by$spacer$user</div></td>
									<td><div align='left'>".$timeposted."</div></td>								
		<td><div align='left'><a href='bulletin.php?bulletin=$messageid'>Read</a></div></td>
									</tr><P>";

						} while ($row = mysql_fetch_array($query));   


				}


                  	else {

					//this is printed if nothing is found in the table

                  		print "<tr>
                  					<td></td>
                  					<td>No bulletin found!!!</td>
                  				</tr>";
                  	}
                  

			  
                  	?>

 

Thanks in advance

 

Link to comment
https://forums.phpfreaks.com/topic/52717-solved-next-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.