Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*************************************************************************************
- main index.php file using jquery method
- /*************************************************************************************
- $('a.add').live("click",function() {
- $.ajax({
- type: 'get',
- url: 'record-insert.php',
- data: 'ajax=2&insert=' + $('#ins_job').attr("value"),
- success: function(e) {
- var parent = $("div:last").parent();
- parent.append('<div class="record" id="record'+e+'"><a href="#" class="delete">delete</a><strong>' + $('#ins_job').attr("value") + '</strong></div>');
- }
- });
- return false;
- });
- /*************************************************************************************
- record-insert.php
- /*************************************************************************************
- <?php
- include('./intranet/lib/conf/dbconnect.php');
- if(isset($_GET['insert']))
- {
- $result1 = oci_parse($conn,"SELECT MAX(JOB_ID) maxid FROM eo_jobtitle");
- oci_execute($result1);
- $max_row=oci_fetch_array($result1);
- $max_id=$max_row['MAXID'] + 1;
- echo $max_id;
- $result2 = oci_parse($conn,"INSERT INTO eo_jobtitle(JOB_ID,JOB_NAME,JOB_LEVEL) VALUES(".$max_id.",'".$_GET['insert']."',1 )");
- oci_execute($result2);
- }
- ?>
Add Comment
Please, Sign In to add comment