PHPjQueryajax form submission small example (including insert, select)
Function description: Able to add records to the MySQL database through forms, and provide keywords for query in the form index.html Seller function simulation:Register sales record>> Customer name Customer phone number Purchase date Goods number Goods name Purchase quantity Display results here Query sales records>> Select category: Customer name Customer phone number Goods number Goods name Shopping date Query value : The seller query results are displayed hereCustomer function simulation: Goods Verification>> Customer Name * Customer phone number * Goods number * The verification results are displayed here index.html rendering function.js // Javascript Document//Insert record $(function(){ $(” #button”).click(function(){ $(“#insertStatus”).text(“Saving, please wait…”); //Show reminder //Get user value txtUserName=$(“#txtUserName “).val(); txtUserTel=$(“#txtUserTel”).val(); txtDate=$(“#txtDate”).val(); txtGoodsID=$(“#txtGoodsID”).val(); txtGoodsName =$(“#txtGoodsName”).val(); txtGoodsNum=$(“#txtGoodsNum”).val(); //Interact with the background program in ajax mode $.ajax({ url:’insert.php’, type :’post’, dataType:’html’, data:{postUserName:txtUserName,postUserTel:txtUserTel,postGoodsID:txtGoodsID,postGoodsName:txtGoodsName,postGoodsNum:txtGoodsNum,postDate:txtDate}, success:function(data) { if(data= =1) $(“#insertStatus”).text(“Save successfully”); else $(“#insertStatus”).text(“Save failed”); } }) }) })// Query all records $( function(){ $(“#button2”).click(function(){ $(“#queryResult”).text(“Querying, please wait…”); $.ajax({ url:’query .php’, type:’post’, dataType:’json’, data:{queryType:’all’}, //Set the query type variable to let the background program distinguish whether it is an all query or a conditional query //If the query is successful, call the function Return results success:showQueryResult, //Query failed, display prompt error:function(){ $(“#queryResult”).html(“No result found. “); } }) })…
PHP sorting algorithm (insert, select, exchange, bubble, fast)
php Algorithms function Array select ip insert Write your review! Let’s make a fuss, see everything Member Login | User Registration recommended reading php Cocos2dX 3.0 event distribution mechanism In the past two days, I have been using cocos2d-js to make a radish pulling game, and I have studied the event distribution mechanism of cocos2d, and I will share it in summary. The event distribution mechanism in event Cocos2d-JSv3.x has been rewritten, and events can be associated with any object… [detailed] Crayon Shinchan 2023-09-02 04:21:20 php PHP gets the value from the array with the Key value – PHP Get Value from Array with Value of Key following problem: I want to build a mysql based language system. The following problem: I want to build a language system based on mysql. Todec… [detailed] Crayon Shinchan 2023-09-02 04:30:27