I've been searching for some answers but can't figure out what's happening.
The SQL connection is working perfectly, I've checked it. So I have this POST method.
if(isset($_POST['new_data'])) {
$new_nm = mysqli_real_escape_string($db, $_REQUEST['new_name']);
$new_pstn = mysqli_real_escape_string($db, $_REQUEST['new_position']);
...
$db->query("INSERT INTO data (name, position, description, twitter, email, image) VALUES('$new_nm', '$new_pstn',
'$new_dscrpt', '$new_twt', '$new_mail', '$new_img')");
}
And here's the form from where I'm getting the data:
<form role="form" method="post">
<label>Name</label>
<input name="new_name" class="form-control" />
<label>Position</label>
<input name="new_position" class="form-control" />
...
<button type="submit" name="new_data">Submit!</button>
</form>
When I click in the button I don't get the data inserted. What am I doing wrong? I have another POST method with a different name which is working (that one makes an UPDATE).
Thanks a lot.
idENUM('') NOT NULL PRIMARY KEY,nametext NOT NULL,positiontext NOT NULL,descriptiontext NOT NULL,twittertext,emailvarchar(60),imagevarchar(300) NOT NULLidfield. Convert it to int and may be add it AUTO_INCREMENT option