R1der Posted March 9, 2007 Share Posted March 9, 2007 if($gangdata['gangPIC']) //line 62 { print "<img src='{$gangdata['gangPIC']}' alt='Gang Picture' width='468' height='60' /><hr />"; } else { print "<b>No Gang Picture</b><hr />"; } I get this error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /****/******/*******/******.php on line 62 It all worked fine till i added that, i could'nt spot a problem with it and its prob something simple. Thanks for your time Quote Link to comment Share on other sites More sharing options...
Orio Posted March 9, 2007 Share Posted March 9, 2007 Can you show the 5 lines before line 62? Orio. Quote Link to comment Share on other sites More sharing options...
R1der Posted March 9, 2007 Author Share Posted March 9, 2007 global $ir,$c,$h,$gangdata; $pq=mysql_query("SELECT * FROM users WHERE userid={$gangdata['gangPRESIDENT']}",$c); $ldr=mysql_fetch_array($pq); $vpq=mysql_query("SELECT * FROM users WHERE userid={$gangdata['gangVICEPRES']}",$c); $coldr=mysql_fetch_array($vpq); print "<h3><u>{$gangdata['gangNAME']} Gang</u></h3><hr /> Quote Link to comment Share on other sites More sharing options...
Accurax Posted March 9, 2007 Share Posted March 9, 2007 print "<h3><u>{$gangdata['gangNAME']} Gang</u></h3><hr /> should be print "<h3><u>{$gangdata['gangNAME']} Gang</u></h3><hr />"; Quote Link to comment Share on other sites More sharing options...
R1der Posted March 9, 2007 Author Share Posted March 9, 2007 No because it goes like this print "text text text text text text text text "; Quote Link to comment Share on other sites More sharing options...
Accurax Posted March 9, 2007 Share Posted March 9, 2007 then can i suggest u post your entire code Quote Link to comment Share on other sites More sharing options...
R1der Posted March 9, 2007 Author Share Posted March 9, 2007 I am affraid i cant do that. By doing that people will steal the coding Quote Link to comment Share on other sites More sharing options...
R1der Posted March 9, 2007 Author Share Posted March 9, 2007 Dont worry about it, Ill just remove that bit of coding as its fine when i remove that anyways Thanks for your time and your help Quote Link to comment Share on other sites More sharing options...
gazalec Posted March 9, 2007 Share Posted March 9, 2007 isn't the problem in the if statement You have if(variable) but no operator for example if(variable = 10){ echo "This is ten"; }else{ echo "This is not ten"; } Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted March 9, 2007 Share Posted March 9, 2007 pfft, lol. if this is 5 lines DIRECTLY above the first code in the first post then you need to close the string (" global $ir,$c,$h,$gangdata; $pq=mysql_query("SELECT * FROM users WHERE userid={$gangdata['gangPRESIDENT']}",$c); $ldr=mysql_fetch_array($pq); $vpq=mysql_query("SELECT * FROM users WHERE userid={$gangdata['gangVICEPRES']}",$c); $coldr=mysql_fetch_array($vpq); print "<h3><u>{$gangdata['gangNAME']} Gang</u></h3><hr />"; if($gangdata['gangPIC']) //line 62 { print "<img src='{$gangdata['gangPIC']}' alt='Gang Picture' width='468' height='60' /><hr />"; } else { print "<b>No Gang Picture</b><hr />"; } Quote Link to comment Share on other sites More sharing options...
Accurax Posted March 9, 2007 Share Posted March 9, 2007 doesnt if($gangdata['gangPIC']) simply check to see if the array contains anything? hmm.... maybe you do need a != 0 or something to make it work. Quote Link to comment Share on other sites More sharing options...
Accurax Posted March 9, 2007 Share Posted March 9, 2007 doesnt if($gangdata['gangPIC']) simply check to see if the array contains anything? hmm.... maybe you do need a != 0 or something to make it work. allready suggested that .... apparently It is not in fact the 5 lines directly above... and he wont post the rest cos he thinks were theives. just Cant help some people Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted March 9, 2007 Share Posted March 9, 2007 if the variable you are testing is a boolean then you can just run the if statement like this: $foo = true; if($foo){ echo "Foo is true"; }else{ echo "Foo is false"; } or: $foo = false; if(!$foo){ echo "Foo is false"; }else{ echo "Foo is true"; } Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 9, 2007 Share Posted March 9, 2007 I am affraid i cant do that. By doing that people will steal the coding Your asking for help (free!) but you can not show ur code but i dont no any php project that has not been done or supplied free in php, So if your code that inportant dont ask quistions and read the manual i find your statement a reel insault but u whant help what a joke? Quote Link to comment 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.