Next-Previous buttons in Php Gallery

Hello,
I follow the tutorial of Mayank Gandhi of How to build an automated PHP Gallery In Minutes (https://www.sitepoint.com/php-gallery-system-minutes/)

As I am very new to php coding I have some questions.
How can I use the fuctions of edit/delete mention ?

Also how can I add buttons for next-previous image in the full size of image ?

The code I am refering is

else if( $pid )
	{
		$result = mysqli_query($mysql_link, "SELECT photo_caption,photo_filename,photo_title FROM gallery_photos WHERE user_id=$user AND photo_id='".addslashes($pid)."'" );
		
		list($photo_caption, $photo_filename, $photo_title) = mysqli_fetch_array( $result );
		$nr = mysqli_num_rows( $result );
		mysqli_free_result( $result );	

		if( empty( $nr ) )
		{
			$result_final = "\t<tr><td>No Photo found</td></tr>\n";
		}
		else
		{
			$result = mysqli_query($mysql_link, "SELECT category_name FROM gallery_category WHERE category_id='".addslashes($cid)."'" );
			list($category_name) = mysqli_fetch_array( $result );
			mysqli_free_result( $result );	
			
			$previous = 
			$next = 
			$result_final .= "<tr>\n\t<td>
						<a href='viewgallery.php'>Categories</a> &gt; 
						<a href='viewgallery.php?cid=$cid'>$category_name</a></td>\n</tr>\n";

			$result_final .= "<tr>\n\t<td align='center'>
					<br />
					<img src='".$images_dir."/".$photo_filename."' border='0' alt='".$photo_caption."' />
					<br />
				    $photo_title
										<br />
										<br />
					$photo_caption
					
					</td>

					</tr>";
		

		};
	}

Lastly how can i show another php page below of Image caption ?

Thanks in advance, and sorry for the very basic questions…