0

I have the following code:

$insert_stmt->bind_param('sssss', $username, $email, $password, $random_salt, ' . $_SESSION['pid'] . ');

I get this error message:

Parse error: syntax error, unexpected 'pid' (T_STRING) in C:\xampp\htdocs\wildfire\includes\register.inc.php on line 86

What is wrong with the pid? Or am I not able to put a session variable there?

Pathik Vejani
  • 4,263
  • 8
  • 57
  • 98
Max
  • 375
  • 2
  • 9
  • 1
    Don't concate session just use `$insert_stmt->bind_param('sssss', $username, $email, $password, $random_salt, $_SESSION['pid']); ` – Saty Dec 30 '15 at 12:17
  • 2
    TL;TR: you're concatenating a session variable into nothing-ness. as the error says: ***syntax error***. That means the code is invalid, not that you're trying to do something that is not allowed. Syntax highlighting is a wonderful thing. Use it. – Elias Van Ootegem Dec 30 '15 at 12:18
  • now that ^ @EliasVanOotegem is a valid explanation, rather than the low-quality answer given below. – Funk Forty Niner Dec 30 '15 at 12:26

0 Answers0