Not updated data in MySQL on request Update

How to fix?

From the form data fly to the handler. But information is not updated in the MySQL database on the UPDATE request. Everything works fine, without errors, just information in the database is not updated. The code is:

<?php
$db = mysql_connect("localhost", "topuser", "12345");
mysql_select_db("topyarus", $db);
mysql_query('SET NAMES utf8');
if (isset($_POST['id'])) {
    $id = $_POST['id'];
    if ($id == '') {
        unset($id);
    }
}
if (isset($_POST['text'])) {
    $text = $_POST['text'];
    if ($text == '') {
        unset($text);
    }
}
if (isset($_POST['meta_d'])) {
    $meta_d = $_POST['meta_d'];
    if ($meta_d == '') {
        unset($meta_d);
    }
}
if (isset($_POST['meta_k'])) {
    $meta_k = $_POST['meta_k'];
    if ($meta_k == '') {
        unset($meta_k);
    }
}
if (isset($_POST['title'])) {
    $title = $_POST['title'];
    if ($title == '') {
        unset($title);
    }
}
if (isset($_POST['test'])) {
    $test = $_POST['test'];
    if ($test == '') {
        unset($test);
    }
}
if (isset($test)) {
    $text = $test;
}
if (isset($text) && isset($meta_d) && isset($meta_k) && isset($title)) {
    $result_add = mysql_query("UPDATE settings SET text='$text', meta_d='$meta_d', meta_k='$meta_k', title='$title' WHERE id='$id'");
    if ($result_add == 'true') {
        echo "<p>   </p>";
    } else {
        echo "<p>   </p>";
        exit(mysql_error());
    }
} else {
    echo "<p>    !!!</p>";
}
?>

Answer 1

WHERE ID = ‘$ ID.’ “) ZDES POSLE $ ID TO4KA ZACHEM POSTAVILI?


Answer 2

I did so and everything works for me, after this code it is a form with Action = “This page.php”, the main thing is that the GET method is here and in the form, well, or post.

<?php 
  if (isset($_GET["admin_login"])){
  $username = trim($_GET["admin_login"]);
  $password = trim($_GET["admin_password"]);
  $title = trim($_GET["site_title"]);
  $description = trim($_GET["site_description"]);
  $keywords = trim($_GET["site_keywords"]);
  if (($username != "") and ($password != "") and ($title != "") and ($description !=  "") and ($keywords != "")) {
   mysql_query("UPDATE `setting` SET username='$username', password='$password', title='$title', description='$description', keywords='$keywords'");
   $error = "<p><span>  !</span></p>";
}
 else 
  $error = "<p><a>   !</a></p>";
}
?>

Answer 3

corrected, == ‘true’ code works, most likely it was in this


Answer 4

And the word Commit you talk about something?