Why do I get this error:
Warning: PostgresSQL query failed: ERROR: parser: parse error at or near "where" in /web/sites/063/internetmime/www.internetmime.f2s.com/modify.php3
on line 55
When I'm using the following code:
IF ($action == "update"){
$SQL_string = "UPDATE user_table";
$SQL_count = "0";
IF ($input_update_name == "yes"){
$SQL_count++;
$SQL_string .= " SET name = '$input_name'";
}
IF ($input_update_email == "yes"){
IF ($SQL_count > "0"){
$SQL_string .= ",";
}
$SQL_string .= " SET email = '$input_email'";
$SQL_count++;
}
IF ($input_update_user_name == "yes"){
IF ($SQL_count > "0"){
$SQL_string .= ",";
}
$SQL_string .= " SET username = '$input_user_name'";
$SQL_count++;
}
IF ($input_update_password == "yes"){
IF ($SQL_count > "0"){
$SQL_string .= ",";
}
$input_password = md5($input_password);
$SQL_string .= " SET password = '$input_password'";
}
$SQL_string .= " where username = '$cookie_01' and password = '$cookie_02'";
$db_connect = pg_connect("dbname=$dbDatabase host=$dbServer user=$dbUserName password=$dbPassword");
$db_check = pg_exec($db_connect,$SQL_string);
pg_close($db_connect);
pg_Freeresult($db_check);
}
And I have one more question: How do I crearte a unique Id number when using postgreSQL?
Warning: PostgresSQL query failed: ERROR: parser: parse error at or near "where" in /web/sites/063/internetmime/www.internetmime.f2s.com/modify.php3
on line 55
When I'm using the following code:
IF ($action == "update"){
$SQL_string = "UPDATE user_table";
$SQL_count = "0";
IF ($input_update_name == "yes"){
$SQL_count++;
$SQL_string .= " SET name = '$input_name'";
}
IF ($input_update_email == "yes"){
IF ($SQL_count > "0"){
$SQL_string .= ",";
}
$SQL_string .= " SET email = '$input_email'";
$SQL_count++;
}
IF ($input_update_user_name == "yes"){
IF ($SQL_count > "0"){
$SQL_string .= ",";
}
$SQL_string .= " SET username = '$input_user_name'";
$SQL_count++;
}
IF ($input_update_password == "yes"){
IF ($SQL_count > "0"){
$SQL_string .= ",";
}
$input_password = md5($input_password);
$SQL_string .= " SET password = '$input_password'";
}
$SQL_string .= " where username = '$cookie_01' and password = '$cookie_02'";
$db_connect = pg_connect("dbname=$dbDatabase host=$dbServer user=$dbUserName password=$dbPassword");
$db_check = pg_exec($db_connect,$SQL_string);
pg_close($db_connect);
pg_Freeresult($db_check);
}
And I have one more question: How do I crearte a unique Id number when using postgreSQL?