Question: Let's say I want to use a Google spreadsheet to perform a calculation equating to an equation in summation notation, for example...the sum, where x goes from the number in cell A1 to the number in cell A2, is x^3 + 2. So if A1 was 2, and A2 was 7, then this formula in A3 would evaluate as:

(2^3 + 2) + (3^3 + 2) + (4^3 + 2) + (5^3 + 2) + (6^3 + 2) + (7^3 + 2)

How can I do this? I would also like to know how to do this with product notation...which is pretty much the same thing, except you multiply the terms instead of adding them.

Preferably, I'd like to do this with just three (or maybe just one or two more) cells instead of having a whole table for it...because I'd like the user to be able to enter any two whole numbers--there is no upper limit for the maximum.

Answer: 
The reason is that your variable `$admin` contains a newline in the end. Remove it and there will be no problem with this.

You will, however, have a possible SQL injection attack. Use parameters, not inline values.
Remove the `br` or `new line feed tag` and execute it..
and use validation

```
$admin=htmlspecialchars($admin); 

```

**`htmlspecialchars()` to avoid sql injection**

or use **htmlentities**

```
$admin=htmlentities($admin);

```