I am trying to update some fields in a mysql database from php. This always gives me error, and I don't know why. Could you have a quick look?
$sqlupdate_ = "UPDATE $db SET city=$city, country=$country WHERE userIP=$ip;";
$sqlupdate = mysql_query($sqlupdate_);
echo $sqlupdate_;
if($sqlupdate){
//The query returned true - now do whatever you like here.
echo 'success';
}else{
//The query returned false - you might want to put some sort of error reporting here. Even logging the error to a text file is fine.
echo "error: ";
}