I'm having this really wierd problem with inserting a textarea in my form to upload to a database. It's nothing different from the standard text fields, but I get an error when trying to upload the description. Here are my variables, and my code:
$fileTitle = $_POST['title'];
$uplDate = date("M j, y, G:i");
$fileDesc = $_POST['desc'];
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
include('config.php');
include('connect.php');
$query = "INSERT INTO upload (title, desc, date, name, type, size, content ) ".
"VALUES ('$fileTitle', '$fileDesc', '$uplDate', '$fileName', '$fileType', '$fileSize', '$content')";
mysql_query($query) or die('Error, query failed');
The only time I get an error is if I have '$fileDesc' inserted into the query. If I leave it out, it runs through all tickety-boo! I just can't figure it out. The order of the values is consistent with the order in the database. I honestly don't know what it is!!!!
I've got other text files that will upload properly, but just NOT the textarea. I've got the field in the database set to VARCHAR(250) NOT NULL... I just don't get it.
Any help PLEASE! I'm getting so frustrated with what seems like such a simple problem!
🙁 🙁 🙁
Thanks in advance!