jesushax Posted October 13, 2008 Share Posted October 13, 2008 hi all below is code which gave me a syntax error but i cant see where the error is i got Parse error: syntax error, unexpected T_IF in C:\admin\vacancies\edit_vacancy.php on line 50 which is somewhere in the below snippet can anyone help me out? Cheers $ESQL = mysql_query("SELECT `ID`,`City`,`Cons`,`Ref` FROM `tblVacancies` WHERE `Ref`='$Ref'") or die(mysql_error()); $error = mysql_fetch_array(ESQL); if ($error["Cons"] !="1" || $error["Cons"] !="1") { header("Location: /admin/vacancies/edit_vacancy.php?ID=".$error["ID"]."&action=error1"); } elseif (empty($error["Ref"])) { header("Location: /admin/vacancies/edit_vacancy.php?ID=".$error["ID"]."&action=error2"); } else { header("Location: /admin/vacancies/edit_vac_list.php?CAT=$Cat"); } Quote Link to comment https://forums.phpfreaks.com/topic/128171-solved-syntax-unexpected-if-error-i-cant-see-the-problem/ Share on other sites More sharing options...
JasonLewis Posted October 13, 2008 Share Posted October 13, 2008 Well for one, you're missing the $ in front of ESQL inside mysql_fetch_array(). Other than that, it looks okay too me. Quote Link to comment https://forums.phpfreaks.com/topic/128171-solved-syntax-unexpected-if-error-i-cant-see-the-problem/#findComment-663828 Share on other sites More sharing options...
kenrbnsn Posted October 13, 2008 Share Posted October 13, 2008 You forgot the "$" on the variable $ESQL in this line: <?php $error = mysql_fetch_array(ESQL); ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/128171-solved-syntax-unexpected-if-error-i-cant-see-the-problem/#findComment-663831 Share on other sites More sharing options...
jesushax Posted October 13, 2008 Author Share Posted October 13, 2008 dammit now i see! thanks Quote Link to comment https://forums.phpfreaks.com/topic/128171-solved-syntax-unexpected-if-error-i-cant-see-the-problem/#findComment-663839 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.