Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make this only appear on the first page? And how do I separate two cells?
    text
    copied!<p>This code pretty much just shows a a table with 16 cells (4 columns and 4 rows). Except on the top right, there are two "RESERVED" cells. This code also paginates.</p> <p>There's two things I want to fix with this code. Right now the two "RESERVED cells" are the same. Meaning the two cells both say RESERVED. How do I make it so I can change what's inside the two reserved cell. Sorry if this is a little hard to understand.</p> <p>Also, I want the two reserved cells to only be shown on the first page. Other than the first page, it would just echo a table with 4x4 cells, as if the reserved cells weren't there.</p> <p>Can anyone please make this possible? </p> <p>Without further ado, here's the code: <pre><code> $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows&lt;=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $strSQL .=" order by GalleryID ASC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); $cell = 0; echo '&lt;table border="1" cellpadding="2" cellspacing="1"&gt;&lt;tr&gt;'; while($objResult = mysql_fetch_array($objQuery)) { if($cell % 4 == 0) { echo '&lt;/tr&gt;&lt;tr&gt;'; } if($cell == 2 || $cell == 3) { echo '&lt;td&gt;RESERVED&lt;/td&gt;'; **//How do I make it so there are two separate reserve slots, rather than one &lt;td&gt; which controls both cells?** } else { echo '&lt;td&gt;&lt;img src="https://s3.amazonaws.com/thumbnails/' . $objResult["Picture"] . '" /&gt;' . $objResult["GalleryName"] . '&lt;/td&gt;'; } $cell++; } echo '&lt;/tr&gt;&lt;/table&gt;'; ?&gt; &lt;br&gt; view more: &lt;?php if($Prev_Page) { echo " &lt;a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'&gt;prev&lt;/a&gt; "; } { echo "|"; } if($Page!=$Num_Pages) { echo " &lt;a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'&gt;next&lt;/a&gt; "; } ?&gt; &lt;/body&gt; &lt;/html&gt; &lt;?php mysql_close($objConnect); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload