Hi, i've taken a look through the previous answers for updating information in a mysql database and i've compared it to my own. However, the crazy thing doesn't work yet.
- I know there is a valid database connection. I've tested it.
- This is a basic update and below is the relevant section:
<?PHP
function updateinfo($CFirstName, $CLastName, $CPassword)
{
global $link;
$query = "UPDATE clients
SET CFirstName='$CFirstName', CLastName='$CLastName', CPassword='$CPassword'
WHERE CUserName='$CUserName'";
$result = mysql_query($query,$link);
if(!$result)
die ("Update failed: ".mysql_error());
else
{
print "Thank you <B>$CFirstName $CLastName</b>. Your profile has been updated.<BR><BR>";
}
}
$answer = updateinfo($CFirstName, $CLastName, $CPasword);
if(!$answer)
{
mysql_error();
}
else
{
print "Congratulations! Your profile has been added.<BR>";
}
/***************************************************************************************
This prints out the user input on the screen
***************************************************************************************/
foreach ($HTTP_POST_VARS as $key=>$val)
if (gettype($val) == "array")
{
print "$key:<BR>\n";
foreach ($val as $two_dim_value)
print ".....$two_dim_value<BR>";
}
else
{
print "$key: $val<BR>\n";
}
?>
- I get no errors. However, I check the database and obviously, no update was performed.
Thank you for all your help.
Mike