I am trying to sort of hobby around with PHP and MySQL(i).
To be more directly I will tell what I am willing to do: I want a text area to be able to upload text in a database.
Which is easily does. But after a certain row of text it just doesnt appear in the database and no error code is given in the error log or php editing file I made.
The weird thing is that in PhpMyAdmin the query works fine.
Things to consider in your answer:
- I tried to enlarge the max PHP upload size;
- I tried to change the input tag to textarea and vise-versa;
- I tried to add and/or change a max-character class to the tag in specific.
Main processing php:
if (isset($_POST['save'])) {
$id = $_POST['id'];
$author = $_POST['author'];
$gct = $_POST['content'];
mysqli_query($connect, "INSERT INTO get_content (id, content, author) VALUES ('$id', '$gct', '$author')");
$_SESSION['message'] = "content succesfully saved";
header('location: edit.php');
}
if (isset($_POST['update'])) {
$id = $_POST['id'];
$gct = $_POST['content'];
$author = $_POST['author'];
mysqli_query($connect, "UPDATE get_content SET content='$gct', author='$author' WHERE id=$id");
$_SESSION['message'] = "Author updated!";
header('location: edit.php');
}
if (isset($_GET['del'])) {
$id = $_GET['del'];
mysqli_query($connect, "DELETE FROM get_content WHERE id=$id");
$_SESSION['message'] = "Content deleted!";
header('location: edit.php');
}
HTML file for the text area:
<div class="input-group">
<label>Picture or text</label><br>
<textarea id="area4" rows="20" cols="50" autofocus="autofocus" name="content"></textarea>
</div>
No error messages are given in the error_log file or the PhpMyAdmin