MANY THANKS for your reply!

Not quite sure :(

But for instance: when i try to delete a line via browser from the table, it deletes all existing lines on it. It suposed to delete that specified line.
Tried, on line 41, with "", .., '' and `` notations and nothing seams to work anymore.

Runned with your sugestions, same result still, but closer to the end result

Hey! I am a newbie to php, but very interested in. I am currently on highschool and i am trying to make an appointment SQL table that could be managed, in a simple way, via browser that my sister could use. I was getting some results but then i messed up.. :(
i been smashing my head on this:

<?php

   session_start();
   define('ADMIN_PASS', 'password');
   $mysql_server = '------';
   $mysql_nome = '--------';
   $mysql_password = '---------';
   $mysql_database = '-----------';
   $mysql_table = '----------';
   $admin_password = isset($_COOKIE['admin_password']) ? $_COOKIE['admin_password'] : '';
   if (empty($admin_password))
   {
      if (isset($_POST['admin_password']))
      {
         $admin_password = md5($_POST['admin_password']);
         if ($admin_password == md5(ADMIN_PASS))
         {
            setcookie('admin_password', $admin_password);
         }
      }
   }
   $id = isset($_POST['id']) ? $_POST['id'] : '';
   $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
   $nome = isset($_POST['nome']) ? $_POST['nome'] : '';
   $dia = isset($_POST['dia']) ? $_POST['dia'] : '';
   $email = isset($_POST['email']) ? $_POST['email'] : '';
   $estado = isset($_POST['estado']) ? $_POST['estado'] : 0;
   $telefone = isset($_POST['telefone']) ? $_POST['telefone'] : '';
   $hora = isset($_POST['hora']) ? $_POST['hora'] : '';
   $db = mysql_connect($mysql_server, $mysql_nome, $mysql_password);
   if (!$db)
   {
      die('Failed to connect to database server!<br>'.mysql_error());
   }
   mysql_select_db($mysql_database, $db) or die('Failed to select database<br>'.mysql_error());
   if (!empty($action))
   {
      if ($action == 'delete')
      { 

         $sql = "DELETE FROM `marcacao` WHERE `marcacao`.`id` = `id`";
         mysql_query($sql, $db);
         mysql_close($db);
         header('Location: '.basename(__FILE__));
         exit;
      }
      else
      if ($action == 'update')
      {
         $sql = "UPDATE `".$mysql_table."` SET id = '$id', ";
         if (!empty($_POST['password']))
         {
            $crypt_pass = md5($_POST['password']);
            $sql = $sql . "`password` = '$crypt_pass',";
         }
         $sql = $sql . " `dia` = '$dia', `email` = '$email', `estado` = $estado, `telefone` ...