This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- phpMyAdmin SQL Dump | |
-- version 5.0.2 | |
-- https://www.phpmyadmin.net/ | |
-- | |
-- Host: 127.0.0.1 | |
-- Generation Time: Dec 10, 2020 at 09:46 PM | |
-- Server version: 10.4.14-MariaDB | |
-- PHP Version: 7.2.33 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$con = mysqli_connect("localhost", "root", "", "api"); | |
if($con) { | |
// echo "Connection Established"; | |
} else { | |
die(); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "connection.php"; | |
$data = json_decode(file_get_contents("php://input")); | |
$name = $data->name; | |
$age = $data->age; | |
$phone = $data->phone; | |
$query = "CALL st_insertUser('$name', $age, '$phone')"; | |
if(mysqli_query($con, $query)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "connection.php"; | |
$data = json_decode(file_get_contents("php://input")); | |
$id = $data->id; | |
$name = $data->name; | |
$age = $data->age; | |
$phone = $data->phone; | |
$query = "CALL st_updateUser('$name', $age, '$phone', $id)"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "connection.php"; | |
$query = "CALL st_getUser()"; | |
$response = array(); | |
$res = mysqli_query($con, $query); | |
if(mysqli_num_rows($res)) { | |
while($row = mysqli_fetch_assoc($res)) { | |
$response[] = $row; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "connection.php"; | |
$data = json_decode(file_get_contents("php://input")); | |
$id = $data->id; | |
$query = "CALL st_deleteUser($id)"; | |
if(mysqli_query($con, $query)) { | |
$response["msg"] = "User deleted response from server was a success "; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<meta name="Description" content="Enter your description here" /> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/all.min.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace Config; | |
/** | |
* Database Configuration | |
* | |
* @package Config | |
*/ | |
class Database extends \CodeIgniter\Database\Config | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controllers; | |
use App\Models\CrudModel; | |
class Crud extends BaseController { | |
//SELECT DATA | |
function index() { | |
// echo "Hello CI-4"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use CodeIgniter\Model; | |
class CrudModel extends Model { | |
protected $table = 'tbl_users'; | |
protected $primaryKey = 'id'; | |
protected $allowedFields = ['name', 'email', 'gender']; | |
} |
OlderNewer