DISPLAYING VALUE FROM PHP PAGE TO HTML TABLE

How to display values from php page in html table using JQUERY.
I write two programs 1)php 2)jquery

but I do’nt know how to displays values in html table using jquery;

this are two programs
PHP PAGE data retrived from database

<?php // Connects to your Database $waybill_no=$_POST['waybillval']; $con=mysql_connect("10.20.41.241", "Appcreator", "Appcreat@r") or die(mysql_error()); mysql_select_db("ALM_Depot") or die(mysql_error()); $data = mysql_query("SELECT * FROM ticket_data where waybill_no=".$waybill_no) or die(mysql_error()); while($info = mysql_fetch_array( $data )) { echo $info['ticket_id']."-".$info['waybill_no']; echo "
"; } ?>

JQUERY PAGE SHOWING VALUES IN AJAX TABLE

        <script>
        
        function getdetail()
        {
            
        val1=$("#nam").val();
         :D $.ajax({
	url:"test_c.php",
	type:"POST",
	data:{waybillval:val1},
	context:document.body,
	success:function(resp){
              //var res = resp.split("-");
           
               var row = $("<tr></td><td>"+resp+"</td></tr>");
               
                         $("#tbldata").append(row);
                  
                         $("#msg").hide();                  
            },
            beforeSend: function() {

        $("#msg").html("Please wait data is retriving...");
             },
	error: function(){
		//alert('error');
	}
});
        
        }
        
  </script>
</head>
<body>
    <div>TODO write content</div>
   <form>
        <input type="text" id="nam" >
          <input  type="text" id="nam1">
        <input type="button" value="submit" onclick="getdetail();">
          <div  id="msg"></div>
        <table id="tbldata" border="5">
            <tr>
             
                <th>ticket_id</th>  
            <th>Waybill_no</th></tr>
             
        </table>
        
  </form>
    
  </body>

Update your code to PDO and we can help. You are using depracted code.

http://www.phphelp.com/forum/the-occasional-tutorial/beginners-pdo-bumpstart-code-use-it-now!

Sponsor our Newsletter | Privacy Policy | Terms of Service