Hi
I am hoping someone can give me some advice.
I have a user_registration table with the field 'ID' as the user ID field.
I have another file (property_details) which is for users to insert their own records.
What I need to do is to automatically assign their ID from the user_registration table to the field in the property_details file. This is so each record can be associated with the correct owner.
Each page will already show who has logged on via
. $_SESSION ['username'] .
I have a feeling I need to do something like:
// Connect to database
$dbc=mysqli_connect ()
// Grab the user-entered log-in data
$user_username = mysqli_real_escape_string($dbc, trim($_POST['username']));
// Grab the Registered ID
$query=Select ID from user_registration where $username = $user_username
What I am stuck on is:
How to match the registered username and bring back the associated ID
How to automatically stick the returning registered ID from user_registration into my property_details.ID field. (<input name="ID" type="text" id="ID" size="32" />)
Any help would be really appreciate.:-)
Many thanks in advance