1. mr412
  2. General
  3. Monday, September 24 2018, 09:52 AM

function triggerProfileUpdate($user, &$data, $changed, $isNew)
{
$user_id = $user->id;
$uniqueid = "CH" . substr(uniqid($data['lastname'], true), -5, 5);
$db = JFactory::getDbo();
$query = 'UPDATE #__jsn_users SET uniqueid = ' . $db->quote($uniqueid) . ' WHERE id = ' . $user_id;
$db->setQuery($query);
$db->execute();
}


for some reasons nothing is writing to the database.. i tryied also with $db->quote("hhh";) but not working... any idea?
Accepted Answer
admin Accepted Answer
Admin
At line 1 there is a space before <?php tag.
Attachments (1)
  1. more than a month ago
  2. General
  3. # Permalink
admin Accepted Answer
Admin
Hi,
you can use something like this:
function triggerProfileUpdate($user, &$data, $changed, $isNew)
{
$user_id = $user->id;
$uniqueid = "CH" . substr(uniqid($data['lastname'], true), -5, 5);
$data['uniqueid'] = $uniqueid;
}


Of course you need to have a field with alias "uniqueid"
  1. more than a month ago
  2. General
  3. # 1
mr412 Accepted Answer
Thanks for your answer.

In the table jsn_users the column "uniqueid" is still "NULL"
  1. more than a month ago
  2. General
  3. # 2
mr412 Accepted Answer
ah no it works sorry perfect.. but if i log in i got this error:

Failed to start the session because headers have already been sent by "/home/job/html/plugins/jsn/skeleton/skeleton.php" at line 1.
  1. more than a month ago
  2. General
  3. # 3
admin Accepted Answer
Admin
Hi,
can you please send me your skeleton.php file to check it? Please add it into an ZIP archive because upload of PHP files is not allowed.
  1. more than a month ago
  2. General
  3. # 4
mr412 Accepted Answer
thanks!
  1. more than a month ago
  2. General
  3. # 5
cristianbravo Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 6
admin Accepted Answer
Admin
Hi,
this error mean that you have some output in your skeleton.php, this happen in 2 cases:
- You have some space char (or other char) before php declaration like " <?php" or after php closure like "?> "
- You have some function that make an output like "echo" function
  1. more than a month ago
  2. General
  3. # 7
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.