How To Solve Parse Error Syntax Error Unexpected T_else
Contents |
here for a quick overview of the site parse error syntax error unexpected t_else in php Help Center Detailed answers to any questions you might have
Parse Error Syntax Error Unexpected 'else' (t_else) Wordpress
Meta Discuss the workings and policies of this site About Us Learn more about
T_else Php
Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
T_else Error In Php
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Parse error: syntax error, unexpected 'else' (T_ELSE) [closed] up vote -4 down vote syntax error, unexpected 'else' (t_else) laravel favorite I edit this code to display a mesaje when select is null and i get this error: Parse error: syntax error, unexpected 'else' (T_ELSE) in /nginx/user/reports.php on line 235 This is code: $stmt = $mysqli->prepare("SELECT date, impressions, balance, username FROM reports WHERE username = '$username' and date between '$firstDay' AND '$lastDay'"); $stmt->execute(); $stmt->store_result(); $rows = $stmt->num_rows; mysqli_stmt_bind_result($stmt,$date,$impressions,$balance,$username); if ($rows > 0){ while (mysqli_stmt_fetch($stmt)) { $ecpm_t3 = $balance*1000; $ecpm3 = $ecpm_t3/$impressions; $rate = number_format((float)$ecpm3, 2, '.', ''); echo"
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and php else policies of this site About Us Learn more about Stack Overflow the parse error: syntax error, unexpected end of file company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users parse error: syntax error, unexpected $end Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes http://stackoverflow.com/questions/21075325/parse-error-syntax-error-unexpected-else-t-else a minute: Sign up Parse error: syntax error, 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 http://stackoverflow.com/questions/22562818/parse-error-syntax-error-unexpected-t-else image."; else { if (!$insert = mysql_query("insert into testblob values('','$image','$img_name')")); echo "Problem 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