[JQuery, SQLServer]Using JQuery to create CRUD program without refresh with php, bootstrap, and SQLServer

in #utopian-io7 years ago (edited)

What Will I Learn?

  • CRUD program without refresh
  • Using SQLServer database
  • Using modal botstrap

Requirements

  • SQLServer is installed and already configured with xampp

Difficulty

  • Basic

Make Create, Read, Update and Delete file

Create file connection

To create a database connection with SQLServer is almost the same as making a connection with MySQL, different only syntax calling it. as shown in the picture below

you can copy this script.

<?php error_reporting(E_ALL ^ E_DEPRECATED); error_reporting(E_ALL ^ E_NOTICE | E_WARNING); error_reporting(0);
$host2 = "KELVINF";

$konekinfo2= array( "Database"=>"crud", "UID"=>"sa", "PWD"=>"syaikelvin11");
$konek = sqlsrv_connect($host2, $konekinfo2);
if(!$konek){
    echo "Failed to connect";
}

?>

save with name konek.php

after that make file index.php

the original file will I give at the end of the post :)

then give ajax script to input data, edit data, and also delete data without refreshing the page

edit.php

This file is used to edit the selected data and displayed via bootstrap modal, file contents as seen in picture below

save.php

this file is used to store data sent via save button on input data form, file contents as seen in picture below

delete.php

this file is used to delete the selected data record, the file contents as seen in the picture below

the result is like this

in essence using ajax this process is faster executable than without using ajax because with this ajax does not refresh page but load the content that is changed only without having to refresh the page.

enough so many tutorials from me, thanks for participating :)

original file Click



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it does not follow the Utopian Rules.

  • We cannot approve contributions with invalid repositories like the one above 42.jpg

Kind Regards

You can contact us on Discord.
[utopian-moderator]

Congratulations @kelvinf! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @kelvinf! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!