MyBB Community Forums

Full Version: why am i getting unexpected T_CONSTANT_ENCAPSED_STRING
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am trying to make up an mysql query to insert the data from one other open source script into the mybb database table but i cant seem to work out what is wrong with this mysql that inserts the data into the mybb table any one got any ideas. i get T_CONSTANT_ENCAPSED_STRING on line 108
$sql = "INSERT INTO 'mybb_users' ('uid', 'username', 'password',
'salt', 'loginkey', 'email', 'postnum', 'avatar', 'avatardimensions',
'avatartype', 'usergroup', 'additionalgroups', 'displaygroup',
'usertitle', 'regdate', 'lastactive',  'lastvisit',
'lastpost','website', 'icq', 'aim', 'yahoo', 'msn',
'birthday','birthdayprivacy', 'signature', 'allownotices',
'hideemail','subscriptionmethod', 'invisible', 'receivepms',
'pmnotice','pmnotify', 'remember', 'threadmode', 'showsigs',
'showavatars', 'showquickreply', 'showredirect', 'ppp', 'tpp',
'daysprune', 'dateformat', 'timeformat', 'timezone', 'dst',
'dstcorrection', 'buddylist', 'ignorelist', 'style', 'away', 'awaydate',
'returndate', 'awayreason', 'pmfolders', 'notepad', 'referrer',
'reputation', 'regip', 'lastip', 'longregip', 'longlastip', 'language',
'timeonline', 'showcodebuttons', 'totalpms', 'unreadpms',
'warningpoints', 'moderateposts', 'moderationtime', 'suspendposting',
'suspensiontime', 'coppauser', 'classicpostbit', 'loginattempts',
'failedlogin') VALUES (2, '".$aname."', '".$apass."', '".$salt."',
'".$login_key."', '".$amail."', 0, '', '', '0', 4, '', 0, '',
1271608659, 1271608659, 1271608659, 0, '', '', '', '', '', '', 'all',
'', 1, 0, 0, 0, 1, 1, 1, 1, '', 1, 1, 1, 1, 0, 0, 0, '', '', '0', 0, 0,
'', '', 0, 0, 0, '', '', '', '', 0, 0, '".$ip"', '', 1603640497, 0, '',
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0)";
'".$ip"'

to

'".$ip."'
Great thank you MattRogowski its stoped the error but i now trying to work out why the drupal code is not running the mysql when i am using its hock. i know this is not fully mybb support here but it has two do with mybb as i trying to import them members when users join

function yourmodule_user($op, &$edit, &$account, $category = NULL) {
 if ($op == 'insert') { 
 
 $con = mysql_connect("localhost","database","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

$aname = $account->name;
$apass = $account->pass;
$amail = $account->mail;
// get the users ip for later
$ip = getenv("REMOTE_ADDR") ;
  
mysql_select_db("data", $con);
$sql = "INSERT INTO 'mybb_users' ('uid', 'username', 'password',
'salt', 'loginkey', 'email', 'postnum', 'avatar', 'avatardimensions',
'avatartype', 'usergroup', 'additionalgroups', 'displaygroup',
'usertitle', 'regdate', 'lastactive',  'lastvisit',
'lastpost','website', 'icq', 'aim', 'yahoo', 'msn',
'birthday','birthdayprivacy', 'signature', 'allownotices',
'hideemail','subscriptionmethod', 'invisible', 'receivepms',
'pmnotice','pmnotify', 'remember', 'threadmode', 'showsigs',
'showavatars', 'showquickreply', 'showredirect', 'ppp', 'tpp',
'daysprune', 'dateformat', 'timeformat', 'timezone', 'dst',
'dstcorrection', 'buddylist', 'ignorelist', 'style', 'away', 'awaydate',
'returndate', 'awayreason', 'pmfolders', 'notepad', 'referrer',
'reputation', 'regip', 'lastip', 'longregip', 'longlastip', 'language',
'timeonline', 'showcodebuttons', 'totalpms', 'unreadpms',
'warningpoints', 'moderateposts', 'moderationtime', 'suspendposting',
'suspensiontime', 'coppauser', 'classicpostbit', 'loginattempts',
'failedlogin') VALUES (2, '".$aname."', '".$apass."', '".$salt."',
'".$login_key."', '".$amail."', 0, '', '', '0', 4, '', 0, '',
1271608659, 1271608659, 1271608659, 0, '', '', '', '', '', '', 'all',
'', 1, 0, 0, 0, 1, 1, 1, 1, '', 1, 1, 1, 1, 0, 0, 0, '', '', '0', 0, 0,
'', '', 0, 0, 0, '', '', '', '', 0, 0, ''".$ip."' ', '', 1603640497, 0, '',
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0)";

	if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
  }
}

?>