I'm trying to do users profiles, form is created and everything, I need help adding logged in user's information to the database, the real problem is users profile information is saving on the same row 🙁
I've given own ID to every single users, but how to update the profile information to Logged in user's ID and view saved data information by userID?
<?php
$username = $session->username;
$email = $session->userinfo['email'];
$userid = $session->userinfo['userid'];
//connect
include 'config.php';
//insert, I think here I have to set userid somehow...
if($_POST['submit'] == "Send")
{
$insert = mysql_query("INSERT INTO profiles (email, username, firstname, lastname, gender, location, birthday, ip, city, occupation, homepage, phone, address, icq, msn, yahoo, interests) VALUES('$email', '$username','$fname', '$lname', '$genderx', '$location', '$birthday', '$ip', '$city', '$occupation', '$homepage', '$phone', '$address', '$icq', '$msn', '$yahoo', '$interests')");
}
$query = mysql_query("SELECT * FROM profiles");
$row = mysql_fetch_array($query);
$username = $row['username'];
$firstname = $row['firstname'];
$lastname = $row['lastname'];
$email = $row['email'];
$gender = $row['gender'];
$location = $row['location'];
$birthday = $row['birthday'];
$city = $row['city'];
$occupation = $row['occupation'];
$homepage = $row['homepage'];
$phone = $row['phone'];
$address = $row['address'];
$icq = $row['icq'];
$msn = $row['msn'];
$yahoo = $row['yahoo'];
$interests = $row['interests'];
//echo to check if this really works..
echo("$username, $firstname $lastname, $email, $gender, $birthday, $location, $ip, $city, $occupation, $homepage, $phone, $address, $icq, $msn, $yahoo, $interests");
?>
please give me a hand on this one.