Question regarding this query
This script allows a user to update his profile.
The user has logged in and now he edit his preference
My UPDATE/WHERE statements are not working.
It is not selecting the appropriate row that is
recongnized by the first_name = $first_name and password = $password
What wrong with this???
$link = @mysql_connect($dbHost, $dbUser, $dbPass);
if (!$link) {
print "&list=" . urlencode("<b>Error:</b> Could not conenct to database") . "&";
exit;
}
if (!@mysql_select_db($dbName)) {
print "&list=" . urlencode("<b>Error:</b> Could not find $dbName database") . "&";
exit;
}
$currentTime = time();
$query = "UPDATE $table SET ScreenName, Telephone, Age, entryDate WHERE first_name = $first_name && password= $password ";
$query .= "VALUES('$disp_ScreenName1', '$disp_Telephone1', '$disp_Age1', $currentTime)";
$result = mysql_query($query);
if (!$result) {
print "&list=" . urlencode("Error: Could not insert record into download log") . "&";
exit;
}
$query = "SELECT * FROM $table WHERE first_name = '$first_name && password= $password' ORDER BY entryDate DESC";
$result = mysql_query($query);
if (!$result || @mysql_num_rows($result) < 1) {
print "&list=" . urlencode("No entries in table $table") . "&";
exit;
}
$list = "";
while($row = mysql_fetch_array($result)) {
$entryDate = strftime("%A %d/%m/%y", $row['entryDate']);
$list .= "<b>Date:</b> " . $entryDate . "<br>";
$list .= "<b>ScreenName:</b> " . $row['ScreenName'] . "<br>";
$list .= "<b>Telephone:</b> " . $row['Telephone'] . "<br>";
$list .= "<b>Password:</b> " . $row['Password'] . "<br>";
$list .= "<b>Age:</b> " . $row['Age'] . "<br><br>";
}
print "&list=" . urlencode($list) . "&";
mysql_close($link);
?>