Jump to content

Whats wrong with this?


R1der

Recommended Posts

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.