Damuslo Damuslo - 8 months ago 37
SQL Question

Save Description using textarea in mysql with php

enter image description herecan anybody help me how to save text in my text area in MySQL and view it into another page.[![enter image description here][2]][2]

and this is my code:

if(empty($_POST['position'])) {
echo '<script> alert("position is required!"); </script>';
$position = test_input($_POST["position"]);
$description = $_POST["description"];
$sql= "insert into tbl_jobdescription(position,description) values ('$position','$description')";
$result = mysqli_query($conn,$sql)or die(mysqli_error());

if($result) {
echo '<script> alert("Successfully add admin account."); </script>';
$position = $description = "";

enter image description here


You need to add the connection in the mysqli_error() function as a parameter See here