I have a field null
to be able to fill it in after the others in the table and it does not leave me. I do not know what I'm doing wrong.
This is the code that you insert in the database, the funny thing is that when you hit the button it tells me that it was added, but it is not like that.
<?php
session_start();
if (!isset($_SESSION['user_login_status']) AND $_SESSION['user_login_status'] != 1 or
$_SESSION['user_permision'] != "Administrador")
{
header("location: login.php");
exit;
}
require_once ("config/db.php");
require_once ("config/conexion.php");
$active_ticket="active";
$title="Prestamos | Simple Stock";
?>
<html>
<head>
<script src="ckeditor/ckeditor.js"></script>
</head>
<body>
<form action="" method="post">
<textarea class="ckeditor" name="editor"></textarea>
<input type="submit" value="Responder">
</form>
</body>
</html>
<?php
if(isset($_POST['editor'])){
$text = $_POST['editor'];
$query = ("INSERT INTO ticket (Respuesta) VALUE ('$text')");
if($query)
{
echo "se ingreso a la DB";
}
else
{
echo "No se ingreso";
}
}
?>
config / db.php
<?php
session_start();
if (!isset($_SESSION['user_login_status']) AND $_SESSION['user_login_status'] != 1 or
$_SESSION['user_permision'] != "Administrador")
{
header("location: login.php");
exit;
}
require_once ("config/db.php");
require_once ("config/conexion.php");
$active_ticket="active";
$title="Prestamos | Simple Stock";
?>
<html>
<head>
<script src="ckeditor/ckeditor.js"></script>
</head>
<body>
<form action="" method="post">
<textarea class="ckeditor" name="editor"></textarea>
<input type="submit" value="Responder">
</form>
</body>
</html>
<?php
if(isset($_POST['editor'])){
$text = $_POST['editor'];
$query = ("INSERT INTO ticket (Respuesta) VALUE ('$text')");
if($query)
{
echo "se ingreso a la DB";
}
else
{
echo "mecachis";
}
}
?>
conexion.php
<?php
$con=@mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
if(!$con){
die("imposible conectarse: ".mysqli_error($con));
}
if (@mysqli_connect_errno()) {
die("Conexión falló: ".mysqli_connect_errno()." : ". mysqli_connect_error());
}
?>
This is the mysql DB the field I want to edit is respuesta