Skip to main content

Posts

MySQL cheatsheet

  MySQL Cheatsheet Loading... Database It is defined as a collection of interrelated data stored together to serve multiple applications. What is Database? MySQL Elements MySQL has certain elements that play an important role in querying a database. Literals Literals refer to a fixed data value 17 #It is a numeric literal "Harry" #It is a text literal 12.5 #It is a real literal Data Types Data types are means to identify the type of data. #Numeric INT -- Integer data type TINYINT SMALLINT MEDIUMINT BIGINT FLOAT(M,D) -- Floating point data type DOUBLE(M,D) -- Double data type also stores decimal values DECIMAL(M,D) -- Decimal data type #Data and Time DATE -- Date data type (YYYY-MM-DD) DATETIME -- It's a date and time combination (YYYY-MM-DD HH:MM:SS) TIME -- It stores time (HH:MM:SS) #String/Text CHAR(M) -- Character data type VARCHAR(M) -- Variable character data type BLOB or TEXT NULL Values If a column has no value, then it is said to be NULL Comments A comment i...

Php Cheatsheet

  Php Cheatsheet Loading... Basics Hello World echo function is used to display or print output <?php echo "Hello World!"; ?> Comments Commets are used to make the code more understandable for programmer, they are not executed by compiler or interpreter. One Liner This is a singleline comment // Twinkle Twinkle Little Star Another One Liner This is a single-line comment # Chocolate dedo mujhe yaar Multiline This is a multiline comment /* Code With Harry */ Vardump This function dumps information about one or more variables. <?php var_dump(var1, var2, ...); ?> Variables Variables are "containers" for storing information. Defining Variables <?php $Title = "PHP Cheat Sheet By CodeWithHarry"; ?> Datatypes Datatype is a type of data String A string is a sequence of characters, like "Hello world!". <?php $x = "Harry"; echo $x; ?> Integer An integer is a number without any decimal part. <?php $x = 1234; var_dump(...