Hi,
I currently have a login system working with a current user that’s logged in. What I need to do is update a user’s information in the db.
EG user_ID logged in and has a proposal section in their db table. There is a form data textbox that need to insert text into that user’s text proposal section only.
Proposal Code
<h2>Proposal</h2>
<ul>
<form action="submisson_insert.php" method="post">
Proposal:
<textarea name="content" rows="5" cols="40"></textarea>
<input type="submit" value="Add Proposal" />
</form>
<br />
Insert Code
// This will echo the current logged in user <?php echo $_SESSION['firstname']; ?>
$sql= "UPDATE users SET proposal = 'CODE entered in form' WHERE user_ID = Current logged user";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
header("Location: student_content.php"); // redirect back
mysqli_close($con);