Home > syntax error > parse error syntax error unexpected t_else in php

Parse Error Syntax Error Unexpected T_else In Php

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site

Parse Error Syntax Error Unexpected 'else' (t_else) Wordpress

About Us Learn more about Stack Overflow the company Business Learn more about syntax error, unexpected 'else' (t_else) laravel hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join unexpected else in r the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Parse error: syntax error,

Php Else

unexpected T_ELSE up vote 0 down vote favorite i just need help regarding my code becuase i odnt have any idea where is the syntax error. $file = $_FILES['image']['tmp_name']; if (!isset($file)) echo "Please select an image"; else { $image = addslashes(file_get_contents($_FILES['image']['tmp_name'])); $img_name = addslashes($_FILES['image']['name']); $img_size = getimagesize($_FILES['image']['tmp_name']); if ($img_size == FALSE) echo "select valid image."; else { if (!$insert = mysql_query("insert into testblob values('','$image','$img_name')")); echo "Problem

Unexpected {{else}} Meteor

uploading!"; else { $lastid = mysql_insert_id(); echo "Image uploaded.

Your image:

"; } } } i just need to know where is the error. thnaks for the help. more power .. php mysql share|improve this question edited Mar 21 '14 at 15:28 Pavel Štěrba 1,6331629 asked Mar 21 '14 at 15:24 user2699948 816 Which line PHP reports you? –Pavel Štěrba Mar 21 '14 at 15:25 Indenting your code may make the solution obvious. –fedorqui Mar 21 '14 at 15:25 4 i know its possible to do if..else without curly braces, but you really should just always use curly braces even if its only one line... –celeriko Mar 21 '14 at 15:27 also, if (!$insert=mysql_query("insert into testblob values('','$image','$img_name')")); should not have a ; at the end.. –celeriko Mar 21 '14 at 15:27 @celeriko, found my error. thanks! –user2699948 Mar 21 '14 at 15:31 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote You have a semi-colon ; in your conditional statement extra here: if (!$insert=mysql_query("insert into testblob values('','$image','$img_name')")); Remove it and change it to: if (!$insert=mysql_query("insert into testblob values('','$image','$img_name')"))

here for a quick overview of the site Help Center Detailed answers parse error: syntax error, unexpected end of file to any questions you might have Meta Discuss the workings

If Else Php

and policies of this site About Us Learn more about Stack Overflow the company Business else if Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the http://stackoverflow.com/questions/22562818/parse-error-syntax-error-unexpected-t-else Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Parse error: syntax error, unexpected T_ELSE - WHY? [closed] up vote -1 down vote favorite So I have the following code on my http://stackoverflow.com/questions/13073038/parse-error-syntax-error-unexpected-t-else-why index.php:

Department Chooser

© Copyright 2019|winbytes.org.