Textfield inserted only value ('1') in database why?

i have a form:

<form class="form-horizontal" action='' method='post'  >
  <input type="text"  name="recipyname" class="span6" id="typeahead"  />
    <input type='submit' name='submit' value='Add New'class="btn btn-primary"/>
 <textarea class="input-xlarge textarea"  name='disc' placeholder="Enter text ..." style="width: 810px; height: 200px"></textarea>
</form>

 **php code:**

if(isset($_POST['submit']))           //if submit btn is pressed
{
	
			
		$respname = $_POST['recipyname'];
		$disc = $_POST['disc'];   

$sql = "INSERT INTO recipes(resname,rtext) VALUES('$respname','$disc')";  
mysqli_query($db, $sql); 
?>

when i just press submit button in resname column only inserted 1 i dont know whats happened where i m getting wrong can any one help?

data type of resname column is varchar

here is the image of table:
Untitled

Can you run this code on your SQL ?

INSERT INTO recipes(resname,rtext) VALUES('3','test')

And reply with what gets inserted.

yes! 3 inserted successfully in resname column.
but whey i try to insert using $_POST method i Can’t.

Add this
echo $respname;
After that variable

1 Like

That was not a problem maybe some external source effect the actual value maybe i want to put this inside into if condion…

1 Like

Ohkyyy Now its worked! Thnkyou for helping me ckhanvand… You really a kind hearted god bless you…

1 Like