Search the Community
Showing results for tags 'php syntax'.
-
I'm writing code to update 2 cells of an sql table and I'm getting a syntax error with the following line of code UPDATE afdt3235 SET 102='NdNicSg98NkM9cEZB7/SNQ==', 103='N' WHERE 104='42' I'm currently using: Server type: MariaDB Server version: 10.1.22-MariaDB - mariadb.org binary distribution Protocol version: 10 Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/7.1.4 Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $ PHP version: 7.1.4 here is the entire error that I am getting: Error updating record: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '102='NdNicSg98NkM9cEZB7/SNQ==', 103='N' WHERE 104='42'' at line 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
- 2 replies
-
- php syntax
- error
-
(and 2 more)
Tagged with: