error MySQL server version for the right syntax to use near '(menuname) =('') where menuname=('Food Menu')'
<p>I have 2 arrays, <code>$arr</code> for the old menu name, and <code>$arr1</code> for the new menu name. I want to replace the old menu name with the new in my database. I have the following code but it throws out an error.</p>

<pre><code>&lt;?php
$arr  = explode(',', preg_replace('/^.*\[(.*)\].*$/', '$1', trim($_POST['menuname'],
                                                                 '[]')));
$arr1 = explode(',', preg_replace('/^.*\
       [(.*)\].*$/', '$1', trim($_POST['editmainmenu'], '[]')));

mysql_connect("localhost", "root", "root");
mysql_select_db("test");
foreach ($arr as $key =&gt; $value)
{
    $value1 = $arr1[$key];

    mysql_query("update test set (menuname) =('" .
                    mysql_real_escape_string($value1) . "') where menuname=('" .
                    mysql_real_escape_string($value) . "')")or
        die('unable' . mysql_error());
    echo "updated";
}
?&gt;
</code></pre>

<p>I get the following error:</p>

<pre><code>04-09 19:06:27.201: I/System.out(1291): unableYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(menuname) =('') where menuname=('Food Menu')' at line 1
</code></pre>

<p>Please tell me how to solve this issue. Thanks!</p>
