I have two fields
<form action="insert.php" method="post">
Firstname: <input type="text" name="firstname" />
Lastname: <input type="text" name="lastname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
how to post name and lastname in one variable meaning in one field of database
is it
<?php
$name=$_post['firstname']['lastname'];
?>
General comment. A good proportion of the world don’t have first and last names.
Better practice is just to ask for “Name”, and stick it in one field.
If you must split ’em, then “given name” and “family name” are better labels.