<?php
	session_start();
	include"../../connect/db.php"; 
 ?>  
<?php
	if( $_POST['purpose'] ){
		$purpose = $_POST['purpose'] ;

		$sql = mysqli_query($con, "SELECT * FROM errormsg WHERE purpose = '$purpose' ");

		while( $row = mysqli_fetch_assoc($sql) ){									
			echo
			'
                <div class="login-form">
                    <form class="regForm form">
                        <div class="form-group">
                            <input readonly class="au-input au-input--full" type="text" name="purpose" value="'.$row['purpose'].'">
                        </div>
                        <div class="form-group">
                            <textarea rows="4" class="au-input au-input--full" name="msg" id="msg" >'.$row['msg'].'</textarea>
                        </div>
                        <span onclick="editMsg2()" class="au-btn au-btn--block au-btn--green m-b-20">Update</span>
                    </form>    
                </div>
			';
		}
	}
	else{

		echo "error";
	}
?>