$status = 555; echo $status; $result = mysql_query("UPDATE $db_table SET status = $status WHERE id ='$id'"); // Проверяем, есть ли ошибки if ($result == 'TRUE') { echo "Статус установлен!. <a href='profile.php'>Вернуться</a>"; } else { echo "Ошибка! Статус не установлен."; } 

If the value of $ status = number, then in the database it is entered, if the text, then no, what's the problem?

    1 answer 1

    I will refrain from unnecessary comments ...

     //Во-первых: $result = mysql_query("UPDATE $db_table SET status = '".mysql_real_escape_string($status)."' WHERE id ='$id'"); // Во-вторых: if ($result) { echo "Статус установлен!. <a href='profile.php'>Вернуться</a>"; } else { echo "Ошибка! Статус не установлен."; } 
    • Thank you so much! :) - angers777