<?php
///////////////listando///////////////
       /*$v = $_REQUEST["id"];
       $connect = mysqli_connect("localhost","root","","bdsistemas");
	   $sql = "select * from m_chat where (iddoc_curso =".$v.")";    //)
	   $res = mysqli_query($connect,$sql);
	   if(mysqli_num_rows($res)>0)
	   {
		   while($row = mysqli_fetch_array($res))
		   {
		      echo '<p>'.$row['name'].": ".$row['message'].'</p>';
		   }
	   }*/
////////////////insertando///////////
$connect = mysqli_connect("localhost","root","","bdsistemas");
$name=$_POST['name'];
$msg=$_POST['msg'];
$iddoc = $_POST['iddoc'];

$sql = "insert into m_chat (name,message,iddoc_curso) values ('".$name."','".$msg."',1)";

mysqli_query($connect,$sql);
?>