0

Ok here's the situation;

I have these tables setup in MySQL;

Table name - Users
UserID - INT Primary key Auto increment
Email - VARCHAR
Password - VARCHAR
Firstname - VARCHAR

Table name - WallPosts
PostID - INT Primary key Auto increment
UserID - INT Foreign key
Email - VARCHAR
Comment - VARCHAR

Here's the problem -

The user logs in

The user uses a form to place a comment into the table 'WallPosts'

The comment shows up in the table

But the users UserID and Email do not show up in the table

How do I set a php script so that the script takes the logged in users Email and UserID and places them in the 'WallPosts' table along with the 'Comment' from the form?

Thanks in advance :)

Edited by ben.matthews18: n/a

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by chrishea
0

If you have variables containing these values, then you need to include some hidden input variables (<input type=hidden ...) in your form and set the values to the variables with the email and userid. Your backend update will need to include these variables in the mysql insert.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.