0

please i need help. I'm not perfect on this so I followed a tutorial. and i get a "Parse error: syntax error, unexpected T_VARIABLE" on this line:

function updatephto($id,$tmpName,$ext){
if(move_uploaded_file($tmpName,"photos/userimages/".$id."."$ext) && mysqli_query("UPDATE `register` SET `photo`='".$ext."' WHERE `id`=".$id));

}

but in the tutorial, there was no error. Please help me out

1 Answers1

1

You forgot to add (.) before $ext in move_uploaded_file

if(move_uploaded_file($tmpName,"photos/userimages/".$id."."$ext)

should:

if(move_uploaded_file($tmpName,"photos/userimages/".$id."." . $ext)
FrozenFire
  • 671
  • 14
  • 28
  • thanks frozenFire. answered. –  Jan 20 '16 at 02:40
  • but i need more help. i get this error also: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING. and here is the line given; –  Jan 20 '16 at 02:42
  • echo "" –  Jan 20 '16 at 02:43
  • 2
    When you start a (php) string literal with double-quotes it has to end with double-quotes, and if you start it with a single-quotes ...a single quote ends it. You have mixed that up twice. – VolkerK Jan 20 '16 at 02:45
  • thanks volkerK, it helped –  Jan 20 '16 at 02:54