Php and mysql syntax issues using update instructions


i am trying to figure out the syntax problem in my query the block of code goes like this:

$updatequery = "update patient_dim set dentist_id = $dentist_id where".
                "patient_id = $patient_id";
$queryResult = mysql_query($updatequery,$con);

      trigger_error("insert error" . mysql_error());


then the error goes like this:
Notice: inssert errorYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"1" where patient_id = 4'

i suspect incorrect syntax in the $updatequery statement

for further information value of the $patient_id = 1 while the value of the $dentist_id = 4, i have tried all of your approaches still the same error. anyway thanks your helping

Your query needs space after where

$updatequery = "update patient_dim set dentist_id = $dentist_id where patient_id = $patient_id";