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
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
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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.