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 Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/ 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. Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203354 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 /> Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203355 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 />"; Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203356 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 "; Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203363 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 Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203377 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 Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203381 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 Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203386 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"; } Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203391 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 />"; } Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203393 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. Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203396 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 Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203400 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"; } Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203404 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? Link to comment https://forums.phpfreaks.com/topic/41946-whats-wrong-with-this/#findComment-203446 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.