php - Parse error syntax error unexpected if T_IF -
php - Parse error syntax error unexpected if T_IF -
i don't understand why i'm getting parse error: syntax error, unexpected 'if' (t_if) on if statement. know error if forget ; didn't. see have missed? give thanks you!!
public function action($action, $table, $where = array()) { if (count($where) === 3) { $operators = array('=', '>', '<', '>=', '<='); $field = $where[0]; $operator = $where[1]; $value = $where[2]; if (in_array($operator, $operators)) { $sql = "{$action} {$table} {$field} {$operator} ?"; if (!$this->query($sql, array($value))->error()) { <-- line throwing error homecoming $this; } } } homecoming false; }
if want can set whole db.class.php here don't see reason to. ask.
when pasted code phpstorm can see character on end of $sql = "{$action} {$table} {$field} {$operator} ?";
i remove character , checks out. when paste character in here it's invisible. seek deleting characters before , after, type them in.
php oop pdo
Comments
Post a Comment