i have html/php code with form standard desing that includes textarea item. i can't find the way to add textarea content to a table in mysql database.
html/php
<form action="this_file.php" method="POST">
<textarea class="inputcat" type="text" cols="40" rows="5" name="content"></textarea>
<input type="submit" value="upload text" name="submit">
</form>
<?php
//allow sessions to be passed so we can see if the user is logged in
session_start();
//connect to the database so we can check, edit, or insert data to our users table
$con = mysql_connect('localhost', 'user', 'pass') or die(mysql_error());
$db = mysql_select_db('dbname', $con) or die(mysql_error());
if(isset($_POST['submit'])){
//insert the row into the database
$contenido = $_POST['content'];
$SQL = "INSERT INTO `table1` (`ct`) VALUE('" .$contenido. "')"; // syntax corrected here
$result = mysql_query($SQL) or die(mysql_error());
}
?>
thank you very much.
greetings.
$SQL = "INSERT INTO 'table1' ('ct') VALUE('" .$contenido. "')";... also, did you tryprint_r($_POST);to see what is being sent through??