php - is it possible to insert a long sentence to database? from textarea form -


i'm trying send sentences database. sent sent empty.

this submit form

<td align="center" colspan="3">             <font face="algerian"><h2>todays tazkirah</font>                 <form method="post" id="usrform" action="inserttazkirah.php"  ><br>                 <textarea rows="4" cols="50" type="text" name="tazkirah" form="usrform">                 </textarea><br>                 <input type="submit"><br>                 </form>          </td> 

and process insert database

<?php $con=mysqli_connect("rock","mido","****","fyp"); // check connection if (mysqli_connect_errno())   {   echo "failed connect mysql: " . mysqli_connect_error();   }  $sql="insert tazkirah (version) values ('$_post[version]')";  if (!mysqli_query($con,$sql))   {   die('error: ' . mysqli_error($con));   }   echo '<script> alert ("done!"); </script>'; include_once("admin.php"); mysqli_close($con);  ?> 

in database table have id , version. id auto_increment when click submit id been added text not appearing in database.

thank yoou

try this

$sql="insert tazkirah (version) values ('mysql_real_escape_string ($_post[tazkirah])')"; 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -