我正在使用以下详细信息更新我的表雇主,但在更新时显示上述错误
<?php
$name=$_POST['name'];
$phone=$_POST['phone'];
$lname=$_POST['lname'];
$stmt = $db->prepare("UPDATE employer
SET name='.$name.', phone='.$phone.',lname='.$lanme.'
WHERE username=".$_SESSION['username']." ");
?>
答案 0 :(得分:-1)
查询语句未正确连接。这就是问题所在:
int n = 10, val[10], dp[1024]; //set all the values of dp table to -1 initially
int solve(int mask){
if(__builtin_popcount(mask) == n){
return 0;
}
if(dp[mask] != -1) return dp[mask];
int prev = 1, ans = 0;
for(int i = 0;i < n;i++){
if(((mask >> i) & 1) == 0){ //bit is not set
//try to shoot current baloon
int newMask = mask | (1 << i);
int fwd = 1;
for(int j = i+1;j < n;j++){
if(((mask >> j) & 1) == 0){
fwd = val[j];
break;
}
}
ans = max(ans, solve(newMask) + (prev * fwd));
prev = val[i];
}
}
return dp[mask] = ans;
}