Jump to content

Edit Post


adam87

Recommended Posts

Hey this is my first post on the forums.

 

I've been studying PHP and mySQL for about a year now and currently working on a message board. I've got it working so that the user can only post if they are logged in. So basically I want it to check if the message author is the same as the person logged in and if so to show a edit button below the post.

 

Below is the code I'm doing for the if statement for it to show the edit:

 

$user_check = mysql_query("SELECT user_name FROM reviews"); 


if ($_SESSION['user'] == $user_check )
{
echo "<tr>";
	echo "<td> Edit  </td>";
echo "</tr>";	
}

else
{
echo "<tr>";
	echo "<td> Shit  </td>";
echo "</tr>";	

 

I've written Edit for it to just appear once i got that working I will then modify it to a link etc

Link to comment
https://forums.phpfreaks.com/topic/150381-edit-post/
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.