Hi a user posted a similar question to this earlier today but I didn’t help. So here is the problem, I have a form on edit.php and it allows users to edit their information that the posted upon registration.
Upon submission of edit.php it send the variables to editproc.php where the SQL update command is. The problem is I can’t get the PHP commands in the SQL. If I echo the PHP variables outside the SQL update it echos the correct information so I know the problem is elsewhere. What is does is enters blank values into the SQL table. I have no idea whats going on!
Also if I hard code a value for name such as
UPDATE members SET name = ‘Joe’ WHERE username = ‘$infoUsername’
it works
editproc.php
<?php
//check log in status
require("include/status.php");
//connect to DB
require("include/dbconnect.php");
//Load Username
require("include/getuser.php");
//Process Form
$editPassword = $_POST['editPassword'];
$editPassword2 = $_POST['editPassword2'];
$editName = $_POST['editName'];
$editEmail = $_POST['editEmail'];
$editPhoneNumber = $_POST['editPhoneNumber'];
$editDOB = $_POST['editDOB'];
$editAddress = $_POST['editAddress'];
$editCity = $_POST['editCity'];
$editState = $_POST['editState'];
if ($editPassword != $editPassword2)
{
echo "The passwords do not match!";
}
else
{
echo "$editName Your account has been updated";
mysql_query("UPDATE members SET password = '$editPassword', name = '$editName', email = '$editEmail', phone = '$editPhoneNumber', dob = '$editDOB', address = '$editAddress', city = '$editCity', state = '$editState'
WHERE username = '$infoUsername' ");
}
?>
all of the include files work