0

I created an success form viewing the full name of the user and his username and password on the form after signing up, Now my problem is how to join first name and lastname as fullname and display it on my textbox. you can help me. thanks.

here is my sample success form code:

<form >

     <div class="form-group row" style="margin-top:60px;">
        <!-- Material input -->
        <label for="username" class="col-sm-1 col-form-label"><strong>Name:</strong></label>
        <div class="col-sm-10">
            <div class="md-form mt-0">
                <input type="text" class="form-control" id="name" name="name" style="margin-left:55px; width:180px;" value="<?php echo $name?>" readonly="true">
            </div>
        </div>
    </div>
</form>

here is my sample query:

<?php 

include_once('connection.php');

$sql = "select concat(fname,'',lname) as name from visitor order by id DESC limit 1";
$result = mysqli_query($conn,$sql);
while ($row = mysqli_fetch_array($result)) {

          $fname=$row['fname'];
          $lname=$row['lname'];

}


?>
ace
  • 148
  • 1
  • 2
  • 16

0 Answers0