Tuesday, 17 September 2013

Is it possible to update a table using WHERE email = $_SESSION['email']

Is it possible to update a table using WHERE email = $_SESSION['email']

I want to update an already existing table it only has email and I want to
add first name and last name does this code work to do so?
UPDATE table
SET fname='$fname', lname='$lname'
WHERE email= '$_SESSION['email'].';
Or can I also use this
$sql="INSERT INTO $tbl_name(fname, lname)VALUES( '$fname,
$lname')" WHERE email= '$_SESSION['email'].';

No comments:

Post a Comment