Php Parse Error Syntax Error Unexpected T_if
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 'if' (t_if) wordpress About Us Learn more about Stack Overflow the company Business Learn more syntax error, unexpected 'if' (t_if) laravel about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Parse Error Syntax Error Unexpected If T_if Expecting
Join 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 PHP - Parse
Php Syntax Check Parse Error Syntax Error Unexpected 'if' (t_if) In Your Code
error: syntax error, unexpected T_IF [closed] up vote -1 down vote favorite Parse error: syntax error, unexpected 'if' (T_IF) in StatusIG.php on line 25 I really dont see any problem in my code, why this is happening, please help. Im a beginner in PHP my LINE 25 is >> if($status == 0) $accountdb_ip = "ip"; //Accountserver-IP $accountdb_login = "acc"; //Accountserver-Loginname $accountdb_pw = "psw"; //Accountserver-Passwort $db_ip parse error syntax error unexpected t_if wordpress = "ip"; //DB-Server-IP $db_login = "acc"; //DB-Server-Loginname $db_pw = "psw"; //DB-Server-Passwort $con = mysql_connect($db_ip, $db_login, $db_pw); $con_account = mysql_connect($accountdb_ip, $accountdb_login, $accountdb_pw); if (!$con) { die('Could not connect: ' . mysql_error()); } $name = mysql_real_escape_string($_GET["name"], $con); $result_id = mysql_query("SELECT * FROM player.player WHERE name='".$name."' LIMIT 1", $con); $player_acc_id = mysql_result($result_id, 0, "account_id"); $result = mysql_query("SELECT * FROM account.account WHERE id='".$player_acc_id."'", $con); $status = mysql_result($result, 0, "raiguard") if($status == 0) {echo "0";} elseif($status == 1) {echo "1";} elseif($status == 2) {echo "2";} mysql_close($con); mysql_close($con_account); php mysql if-statement syntax share|improve this question asked Mar 1 '14 at 17:58 user3368877 1112 closed as off-topic by lifetimes, echo_Me, nKn, Merlevede, Taryn East Mar 6 '14 at 2:47 This question does not appear to be about programming within the scope defined in the help center.If this question can be reworded to fit the rules in the help center, please edit the question. 5 This question appears to be off-topic because it is about basic syntax errors. –lifetimes Mar 1 '14 at 18:00 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote You missed the semicolon on the end of: $status = mysql_result($
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and
Syntax Error Unexpected In Php
policies of this site About Us Learn more about Stack Overflow the unexpected if coffeescript 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 of file Badges Ask Question x Dismiss Join 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 http://stackoverflow.com/questions/22118087/php-parse-error-syntax-error-unexpected-t-if a minute: Sign up PHP Parse error: syntax error, unexpected T_IF [closed] up vote -1 down vote favorite I looked at many other questions, but I can't find my own answer in it. here is my syntax error (unexpeted T_IF): while(($rij1 = mysql_fetch_object($result1)) and( if ($voornaam=NULL) { $rij2 = ' ';} elseif($voornaam!=NULL){ $rij2 = mysql_fetch_object($result2);}) I looked at the line before the http://stackoverflow.com/questions/13316003/php-parse-error-syntax-error-unexpected-t-if syntax, but I couldn't find what is wrong... Does someone know it? syntax if-statement php share|improve this question edited Nov 9 '12 at 21:09 hakre 134k26216390 asked Nov 9 '12 at 21:04 user1813397 1612 closed as too localized by j08691, hakre, Mike B, tereško, Peter O. Nov 9 '12 at 22:32 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question. 1 What's with the and and if there? and expects expressions as its operands, not statements. What are you trying to do? –Felix Kling Nov 9 '12 at 21:08 Please, don't use mysql_* functions in new code. They are no longer maintained and the deprecation process has begun on it. See the red box? Learn about prepared statements inst
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to http://board.phpbuilder.com/showthread.php?10368529-RESOLVED-Parse-error-syntax-error-unexpected-T_IF-in proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 3 of 3 Thread: [RESOLVED] Parse error: syntax error, unexpected T_IF in Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 09-28-2009,07:49 PM #1 mattboy View Profile View Forum syntax error Posts Junior Member Join Date Sep 2009 Posts 2 [RESOLVED] Parse error: syntax error, unexpected T_IF in I continue to get an error, "Parse error: syntax error, unexpected T_IF in ....". I can not figure out why this is for the life of me. I am trying to input data into my DB from a form on my website. The form appears to work fine. Thanks, Matt Reply With Quote 09-28-2009,08:55 PM #2 NogDog View Profile View Forum Posts Visit Homepage High Energy Magic Dept. Join Date Aug 2006 Location Ankh-Morpork Posts 14,504 No terminal semi-colon at the end of the preceding command. PS: Welcome to the forum, and in future posts, please be sure to make use of this forum's [php]...[/php] bbcode tags around your PHP code samples in order to make it much easier to read. "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading) My Blog cwrBlog: simple, no-database PHP blogging framework Reply With Quote 09-28-2009,11:48 PM #3 mattboy View Profile View Forum Posts Junior Member Join Date Sep 2009 Posts 2 Thanks a lot for your quick reply. I got it working. Reply With Quote Quick Navigation Coding Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums PHP Help Gener