MasterACE14 Posted July 9, 2007 Share Posted July 9, 2007 I am recieving a parse error, it says: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/ace/public_html/shadowlords/functiondebug.php on line 28 line 28: if($userrow['charname'] == "$userrow['charname'] ~SS~"){ full code: <?php function donate1() { global $userrow; if($userrow['charname'] == "$userrow['charname'] ~SS~"){ $redd = ""; } elseif($userrow['charname'] !== "$userrow['charname'] ~SS~"){ $redd = " ~SS~"; } $charn = "$userrow['charname']"; $bank = "$userrow['bank']"; $maxmp = "$userrow['maxmp']"; $maxtp = "$userrow['maxtp']"; $maxhp = "$userrow['maxhp']"; $strengthh = "$userrow['strength']"; $dexterityy = "$userrow['dexterity']"; $experiencee = "$userrow['experience']"; if ($userrow['verify'] == 1) { $charn = $userrow['charname'] . $redd; $bank = ceil($userrow['bank']+2500); $maxmp = ceil($userrow['maxmp']+25); $maxtp = ceil($userrow['maxtp']+25); $maxhp = ceil($userrow['maxhp']+25); $strengthh = ceil($userrow['strength']+25); $dexterityy = ceil($userrow['dexterity']+25); $experiencee = ceil($userrow['experience']+100); //echo("Transaction Successful!"); } elseif ($userrow['verify'] !== 1) { die("This Page is restricted to people that have verified their accounts"); } $con = mysql_connect("localhost","ace_ACE","******"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("ace_sl", $con); mysql_query("UPDATE `sl_users` SET `charname`='$charn' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `bank`='$bank' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `maxmp`='$maxmp' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `maxtp`='$maxtp' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `maxhp`='$maxhp' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `strength`='$strengthh' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `dexterity`='$dexterityy' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `experience`='$experiencee' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `authlevel`='3' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); }; donate1(); ?> Quote Link to comment Share on other sites More sharing options...
suma237 Posted July 9, 2007 Share Posted July 9, 2007 try this if($userrow['charname'] == $userrow['charname'] ~SS~){ Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 9, 2007 Author Share Posted July 9, 2007 that gives me this error: Parse error: syntax error, unexpected '~' in /home/ace/public_html/shadowlords/functiondebug.php on line 28 Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 9, 2007 Author Share Posted July 9, 2007 any other ideas? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted July 9, 2007 Share Posted July 9, 2007 here, this: if($userrow['charname'] == "{$userrow['charname']} ~SS~"){ just a question... why are you checking whether the same variable has ~SS~ on the end? or am i mistaken? Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 9, 2007 Share Posted July 9, 2007 I was wondering that myself! if($userrow['charname'] == $userrow['charname']." ~SS~"){ Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 10, 2007 Author Share Posted July 10, 2007 its for people who have become members, I want it to add ~SS~ to the end of their name to show their members, and i'm doing the if statement to make sure it doesn't keep adding ~SS~ everytime they become a member lol. had 1 member with 3 ~SS~ 's after his name lol. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 10, 2007 Share Posted July 10, 2007 I guess thats not the proper way to do that maybe you need to add some fields that will contain the active or non the members in non u can have 0 or 1 or y and n to save space Quote Link to comment Share on other sites More sharing options...
no_one Posted July 10, 2007 Share Posted July 10, 2007 Teng84 makes a good point. If you must use the ~SS~ though.. <?php if( substr($userrow['charname'], -4) == '~SS~' ) { } ?> Get last 4 characters of username, compare to ~SS~ .. Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 16, 2007 Author Share Posted July 16, 2007 Thanks for your help guys, I got it working nicely now Regards ACE 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.