SQL Query UPDATE/WHERE statement

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);


?>

try this:

$query = "UPDATE '$table' SET ScreenName = '$disp_ScreenName1', Telephone = '$disp_Telephone1', Age = '$disp_Age1', entryDate = '$currentTime' WHERE first_name = '$first_name' AND password= '$password'";

:esmirk:

I think there is a conflict with a _root.checklog = 0; command I have in the .Fla and it is not accessing the first_name or password

Maybe I’m wrong???

well anyway,

here is the .fla with the two php scripts

Let me know if you can pinpoint this issue

:cool:

try running the php script through the browser, not flash, see if that works…

I am getting this

&list=Error%3A+Could+not+insert+record+into+download+log&

It’s comming from this line in the php

/* If there was an error executing query… */
if (!$result) {

/* Return error information to Flash and quit! */
print "&list=" . urlencode("Error: Could not insert record into download log") . "&";
exit;

}

:bu:

howdi,

ahmed

I’ve tried several things here and it is not letting me update the
rows

It will let me insert fine

but the error keeps comming up

and suggestions?

:tie: