sql updating only one row
<p>I am trying to update only one row using sql, but I am having troubles with it.</p>

<p>I am trying to do something like this:</p>

<pre><code>$sql="UPDATE table SET age='$age' WHERE id=(SELECT id FROM another_table WHERE somecondition ORDER BY id LIMIT 1)";
</code></pre>

<p>but this is not updating anything. I feel like there is some error with where the parenthesis are, but I am not sure what exactly is wrong with it. Does anybody have any idea? or have other suggestions on how to update only one row that satisfies the given conditions?</p>

<p>Edited Notes:</p>

<p>Okay, I may have made my question too complicated. Let me rephrase my question; What is the generic way of updating only 1 row that meets certain conditions. It can be any row if the row meets the conditions. </p>