Posts

Showing posts from May, 2024

Difference Between ?? and ?: in PHP?

Image
 

PHPExcel -- write/save onto existing excel file

https://gist.github.com/milan-sahana/a2c5931b8d97c95cb1efa41d4925b058

Demo: Add to Google Calender link; href=

 https://calendar.google.com/calendar/u/0/r/eventedit?dates=20240511T173000Z/20240511T210000Z &details=%3Ca+href%3D%22https://outskill-api.growthschool.io/v1/redirect?redirect%3Dhttps://webinar.growthschool.io/live/200233?signup%3D71d543c4-691e-4396-bfc2-21d3d8beb771%22%3EClick+on+this+link+to+Join+the+Session%3C/a%3E &text=ChatGPT+101+with+Vaibhav+Sisinty &propsGeneratorKey=webinarCommsLinkClicked &job=trackEvent &eventName=Webinar+Comms+Link+Clicked &trackingProps%5Btemplate_id%5D=onRegistration &trackingProps%5Bcomms_channel%5D=whatsapp &trackingProps%5Bcta_type%5D=calender_link &trackingProps%5Bcta_text%5D=Add+to+Calendar &trackingProps%5Blink_clicked%5D=https://calendar.google.com/calendar/render?action%3DTEMPLATE &dates=20240511T173000Z/20240511T210000Z &details=%3Ca+href%3D%22https://outskill-api.growthschool.io/v1/redirect?redirect%3Dhttps%253A%252F%252Fwebinar.growthschool.io%252Flive%252F200233%253Fsignup%253D71d543c4-691e-4...

php session start

if (session_status() === PHP_SESSION_NONE) { session_start(); }

classDbTable.php

Image
https://gist.github.com/milan-sahana/c42d56711cf1c707f40ae239619f9ec4

MySqli Database Connection

Image
if (! class_exists ( 'Database' )) { class Database { private $db_host = 'localhost' ; private $db_user = 'daso_user1' ; private $db_pass = 'pwd1' ; private $db_name = 'daso_db1' ; private $con = '' ; public $lastQuery = null ; public function __construct () { if ( $_SERVER [ 'HTTP_HOST' ] == 'localhost' ) { $this -> db_host = 'localhost' ; $this -> db_user = 'root' ; $this -> db_pass = '' ; $this -> db_name = 'db_admin' ; } } function __destruct () { // if($this->con) { try { // if(is_resource($this->con) && get_resource_type($this->con) === 'mysql link') { if ( isset ( $this -> con -> server_info )) { /* if server is al...