Question: I build my query in PHP dynamically, and when I try to execute it, it fails. When I copy the query it generated and paste it into the mysql terminal and run it, it works fine. The error I get is "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '>' at line 1" for the following query:

```
UPDATE events SET event = 'orgo lecture', start = '2014-07-24 16:00:00' WHERE userID = 1 AND eventID = 5

```

The following is the code used to generate the query dynamically:

```
$query = "UPDATE events SET ";
$query_list = array();
if ($set_event) {

    $query_list[] = "event = '{$event}'";

}
if ($set_start) {

    $query_list[] = "start = '{$start}'";

}
if ($set_end) {

    $query_list[] = "end = '{$end}'";

}
$query_list_size = count($query_list);
for ($i = 0; $i < $query_list_size - 1; $i++) {

    $query .= $query_list[$i];
    $query .= ", ";

}
$query .= $query_list[$query_list_size - 1];
$query .= " WHERE userID = {$userID} AND eventID = {$eventID}";
echo $query .= "<br />";
$query_result = mysqli_query($connection, $query) or die(mysqli_error($connection));

```

Answer: 
for firephone adb connection you need amazon fire phone sdk provided by Amazon. Inside that sdk you find device driver for firephone then you can connect your fire phone to the system rest thing are same you need to go settings then enable developer option there.
First , you don't need to install the Fire Phone SDK Add-on. I spent an hour on this.

Second [Christina](https://stackoverflow.com/users/2072811/christina)'s instructions are old and the Amazon doc is not up to date.

Here is "How To" on the last update for **Fire OS 4.6.3**

> 
> 1. Open the Settings app.
> 2. Scroll to the "About Your Fire" section and expand the section. Tap on phone number, serial number
> 
> 
> 

[![enter image description here](https://i.stack.imgur.com/e6QHg.png)](https://i.stack.imgur.com/e6QHg.png)

> 
> 3. Now tap repeatedly on **Model Number**.
> 4. A Developer Options button appears at the bottom of the screen.
>  Click that button
> 
> 
> 

[![enter image description here](https://i.stack.imgur.com/TKUTl.png)](https://i.stack.imgur.com/TKUTl.png)

> 
> 5. Set the Developer Options slider to the ON position. Check **USB
>  Debugging**.
> 
> 
>