<p>I have a query:</p>

<p>UPDATE choices SET votes = votes + 1 WHERE choice_id = '$user_choice'</p>

<p>But when I execute it in my script, the votes field is updated twice, so the votes will go from 4 to 6 instead to 5. It doesn't seem that it is getting called twice because I echo out stuff to test this and only get one echo. Is there a way to have it so PHP will only execute this query once per page "refresh"?</p>

<p><strong>EDIT</strong>: Thanks for the responses, I'm using regular MySQL, no MySQLi or PDO. Another thing I found is that when doing the query, it works when you start out with 0 and update to 1, but then after that it goes 3, 5, 7, ...</p>

There are several SQL interfaces for many different brands of database in PHP.  You haven't shown the PHP code you use to execute the query, nor have you identified which brand of database you use.
In some SQL interfaces in PHP, creating the statement implicitly executes the SQL.  Then you have the opportunity to fetch results (if it was a SELECT statement).  If your statement was a SELECT or DELETE, it's likely that no harm was done, though it's unnecessary to execute the statement twice.  If your statement was an INSERT or UPDATE, though, you may find it has taken effect twice.
For example, using PDO:
```
```
$pdo = new PDO(...options...);
$stmt = $pdo->query('UPDATE ...'); // executes once
$stmt->execute(); // executes a second time
```
```