0
        <?php
    if(isset($_POST['zapisz'])) { 
    $zapytanie_update = mysql_query("UPDATE `emotki` SET `kod` = '".$_POST['kod']."',`opis` = '".$_POST['opis']."', `glowna` = '".$_POST['glowna']."' WHERE id= $id");
    echo 'Emotka zapisana.<br/><a href="index.php">&laquo; Powrót</a>';
    }

    $usun = $_POST['usun'];
    if(isset($usun == 1)
    {
    $usuwaj = mysql_query("DELETE FROM `emotki` WHERE 'id'= $id");
    }



else {
?>

i have ( ! ) Parse error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')' in C:\wamp\www\emotki_admin\edytuj.php on line 63

line 63 is if(isset($usun == 1)

where is error?

  • 1
    [**Please, don't use `mysql_*` functions in new code**](http://bit.ly/phpmsql). They are no longer maintained [and are officially deprecated](http://j.mp/XqV7Lp). See the [**red box**](http://j.mp/Te9zIL)? Learn about [*prepared statements*](http://j.mp/T9hLWi) instead, and use [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli) - [this article](http://j.mp/QEx8IB) will help you decide which. – Kermit Jan 26 '13 at 15:47

2 Answers2

7

You're missing a parenthesis:

if(isset($usun) == 1)

But the comparison is unnecessary anyway. All you need is:

if(isset($usun))

since isset() returns a boolean value.

JLRishe
  • 99,490
  • 19
  • 131
  • 169
2

You're missing a parenthesis:

if(isset($usun == 1)

should be

if(isset($usun == 1))
John Conde
  • 217,595
  • 99
  • 455
  • 496