Search the Community
Showing results for tags 'whitespace'.
-
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:
-
This query is not working. I need urgent help. Thanks a lot in adv. ROWS affected: 0 I have cross checked the data in the table for the given condition. $sql = 'UPDATE LTE_noria_cellule cel_bk_up SET cel.NAP_'.$site->ur().' = \'1\' '. 'WHERE cel.nidt IN ( select gn from LTE_noria_candidat_bk_up can INNER JOIN LTE_noria_site_bk_up site ON (site.codesite = can.codesite) WHERE '.$site->get_param('zone_bde').')'; I believe problem is because of WHITESPACE. When i search "codesite" in the table with "LIKE". I can't find it. But when i did "LIKE%" , it's working. I tried this also but not working $sql = 'UPDATE LTE_noria_cellule cel_bk_up SET cel.NAP_'.$site->ur().' = \'1\' '. 'WHERE cel.nidt IN ( select gn from LTE_noria_candidat_bk_up can INNER JOIN LTE_noria_site_bk_up site ON trim(site.codesite) LIKE CONCAT('%',trim(can.codesite),'%') WHERE '.$site->get_param('zone_bde').')';