<?php
session_start();
include 'includes/config.php';
include 'includes/db_inc.php';
$username = $_SESSION['username'];
$sql =mysql_query("SELECT * FROM rsc WHERE username = '$username'") or die(mysql_error());
$row = mysql_fetch_array($sql);
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$oldpass = $_POST['oldpass'];
$newpass1 = $_POST['newpass1'];
$newpass2 = $_POST['newpass2'];
$email1 = $_POST['email1'];
$email2 = $_POST['email2'];
$username = $_SESSION['username'];
if($row['first_name'] !== $fname) {
$newinfo['fname'] = $fname;
}
if($row['last_name'] !== $lname) {
$newinfo['lname'] = $lname;
}
if(isset($oldpass)) {
if($oldpass == $row['password']) {
if((strtolower($newpass1)) == (strtolower($newpass2))) {
$newinfo['password'] = $newpass1;
} else {
$passerror = "Your Passwords Didnt Match";
}
} else {
$passerror = "Your Password is Incorrect";
}
}
if(isset($email1)) {
if($email == $email2) {
$newinfo['email'] = $email;
}
}
Ok now how would i write a sql that would take the $newinfo array and modify the information in the DB..