This file contains hidden or 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
//Constraints = a limitation or restriction, discipline | |
//What is SQL ALTER TABLE statement | |
-> The ALTER TABLE statement is used to add, delete, or modify columns in an existing table. | |
-> The ALTER TABLE statement is also used to add and drop various constraints on an existing table.It is also used to rename a table. | |
--Tables | |
CREATE TABLE states ( |
This file contains hidden or 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
$this->db->query("alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS'"); | |
echo $this->db->last_query(); | |
//Date Save like dd/mm/yy to database as follows: | |
$date = str_replace('/', '-', $this->input->post('tender_date')); | |
$date = date('Y-m-d', strtotime($date)); | |
$data['tender_date'] = date("Y-m-d", strtotime(str_replace('/', '-', $this->input->post('tender_date')))); | |
//Show date like 24th Nov 18, 9:52 AM as follows: | |
echo date("jS M y, G:i A", strtotime($row1->CRE_DT)) |
This file contains hidden or 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
Shortcut method: https://code.tutsplus.com/tutorials/6-codeigniter-hacks-for-the-masters--net-8308 | |
function updateDataBablu($tableName, $data, $condition) | |
{ | |
//Data | |
$arr_data = array_map(function($k, $v){ | |
return "$k='$v'"; | |
}, array_keys($data), array_values($data)); | |
$data_str = implode(", ",$arr_data); | |
//Condition |
This file contains hidden or 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
// ----------------------- '+!!' operator in an if statement------------------------------- | |
It is an unary conversion to give a 0/1 number result | |
+!!true; //this converts true to false, then to true again, and true is 1 when converted | |
+!!0; //converts 0 (falsy) to true, then false, and then the numeric 0 | |
Technically speaking !! is not its own operator, it's just the NOT (!) operator twice. | |
//--------------------------What does “!--” do in JavaScript?----------------------------------------- | |
! inverts a value, and gives you the opposite boolean: |
This file contains hidden or 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
//Form validation: | |
$(document).ready(function() { | |
$("#mobile").on("keyup change", function(){ | |
var mobile = $(this).val(); | |
var formURL = "http://nextadmission.com/form/mobile_check"; | |
$.ajax({ | |
url : formURL, | |
type : "POST", | |
data : { mobile_no : mobile}, | |
success : function(data){ |
This file contains hidden or 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
private function pr($data) | |
{ | |
echo "<pre>"; | |
print_r($data); | |
echo "</pre>"; | |
exit; | |
} | |
//GD2 for thumb and full size image | |
//v.01 |
This file contains hidden or 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
Head: | |
HEAD is a ref (reference) to the currently checked out commit. In normal states, it's actually a symbolic ref to the branch you have checked out. | |
//01// Rollback Using git Reset: | |
->If you want to fix up your latest commit, you can undo the commit, and unstage the files in it, by doing: | |
->If you want to uncommit N commits, but keep the code changes in your working directory: | |
git reset HEAD~N | |
->If we want to delete commit but file will be not changed | |
git reset --soft commit_hash |
This file contains hidden or 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
//01//serializeArray() // Here is not submit button hence all fields dada will not go to url | |
->The serializeArray() method creates an array of objects (name and value) by serializing form values. | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$("button").click(function(){ | |
var x = $("form").serializeArray(); |
This file contains hidden or 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
//i.e.3 Edit | |
->HTML Edit Button maker_list.php | |
<button class="action-buyer" onClick="oneditMaker(<?php echo "'".$maker2['id']."'" ?>)">編集</button> | |
//then (Function Call By button) maker_list.php | |
function oneditMaker(makerId){ | |
editMaker(makerId); | |
if(hideViewMessageChoiceBuyer && typeof hideViewMessageChoiceBuyer === 'function'){ | |
hideViewMessageChoiceBuyer(); | |
} |
This file contains hidden or 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
->XMLHttpRequest (XHR) is (an API) an object whose methods transfer data between a web browser and a web server. The object is provided by the browser's JavaScript environment. | |
i.e $.ajax(), $.get(), $.post() | |
->Syntax: $.ajax({name:value, name:value, ... }) | |
->The parameters specifies one or more name/value pairs for the AJAX request. | |
->Possible names/values in the table below: | |
Name ->Value/Description | |
async ->A Boolean value indicating whether the request should be handled asynchronous or not. Default is true | |
beforeSend(xhr) ->A function to run before the request is sent | |
cache ->A Boolean value indicating whether the browser should cache the requested pages. Default is true |
OlderNewer