Jump to content

Kez323

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Kez323

  1. Hi! I'm getting this PHP syntax error on line 87 of my file. ERROR: PHP Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) The function works fine, if I take the function out of that file and put it into a separate file, it works fine. function get_UserId($username){ include('config.php'); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT id FROM users WHERE username='$username'"; $result = $conn->query($sql); $row = $result->fetch_assoc(); $id = $row['id']; $conn->close(); return $id; } Thanks
×
×
  • 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.