Browse Source

added trim() for the sql statement

Andrew Ellis 12 years ago
parent
commit
100a59c9c4
1 changed files with 3 additions and 1 deletions
  1. 3 1
      laravel/database/connection.php

+ 3 - 1
laravel/database/connection.php

@@ -175,6 +175,8 @@ class Connection {
 	 */
 	 */
 	public function query($sql, $bindings = array())
 	public function query($sql, $bindings = array())
 	{
 	{
+		$sql = trim($sql);
+
 		list($statement, $result) = $this->execute($sql, $bindings);
 		list($statement, $result) = $this->execute($sql, $bindings);
 
 
 		// The result we return depends on the type of query executed against the
 		// The result we return depends on the type of query executed against the
@@ -321,4 +323,4 @@ class Connection {
 		return $this->table($method);
 		return $this->table($method);
 	}
 	}
 
 
-}
+}