Welcome to PHPBuilder! When posting PHP code, please use the board's [noparse]
..
[/noparse] bbcode tags (instead of the generic CODE tags) as they make your code much easier to read and analyze.
As for your parse error, why do you have the comma and $connection on that line? $sql looks like a variable that is simply supposed to hold a SQL query string; you don't make any function calls, so the comma and a variable don't make any sense.
You've also got a few other problems with the code:
Code like this:
if(isset($_POST['cmd']) == "edit")
doesn't make any sense. [man]isset/man returns a boolean TRUE or FALSE, depending upon whether the variable reference you passed to it exists or not.
In other words, you're trying to compare boolean TRUE or FALSE to the string "edit". I'm guessing you should instead be comparing the value of $_POST['cmd'] to the string "edit" (after first checking that the variable was set, of course).
User-supplied data should never be placed directly into a SQL query string else your code will be vulnerable to SQL injection attacks and/or just plain SQL errors. Instead, you must first sanitize the data with a function such as [man]mysql_real_escape_string/man (for string data).
Is there any particular reason why you have the {} brackets on lines 37 and 52?