Please enable JavaScript.
Coggle requires JavaScript to display documents.
MYSQL - PHP - Coggle Diagram
MYSQL - PHP
SQL InJection
INSERT
-
$sql = "INSERT INTO Students (name, lastname, email) VALUES ('Test', 'Testing', 'Testing@tesing.com')";
-
-
-
-
:red_flag: GENERAL
-> in loc de . la objects :check: $myObject->id=5;
$ la orice variabila :check: $var; :check: $var="value";
echo ~ print :check: echo $var;
. in loc de + la concatenare string
global $var => global outsite of the function
:smiley: INTERESTING FACTS about PHP
weakly typed language -> no type of data declaration neded ->
Comments : :check: // :check: / / :check: #
$caseSensitive != $CaseSensitive => vars are case sensitive
classes and functions => are not case sensitive
"\n" - new line
-
:red_flag: Data Types
$regInt = 1234;
$octNum = 01234;
$hexNum = 0xABC;
$BinaryNum = 0b1000;
$float = 1.234;
$scientific = 0.1234E4;
$scientific = 0.1234E-4;
$bool = true;
$bool = false;
constrante : define('NEW_CONSTANT',"Some text") => global variables
String
' '=> tot ce ii inauntru harcodate version versus " " =>
-
PHP inner Functions
is_int($var)=>1/true for int
is_string($var)=>1/true for string
is_bool($var)=>1/true for bool
is_float($var)=>1/true for float
defined('NAME_CONSTANT')=>1/true if const has been defined
Functions :red_flag:
function functionName($parm1, $parm2="default")
{
echo $parm1;
echo $parm2;
}
functionName("name","new name");
functionName("name");
function getAuthor()
{
return "something";
}
getAuthor(); :red_cross:
$var = getAuthor(); :check:
$variableFunctionName = "getAuthor";
$variableFunctionName(); :check:
-
-
-
-
-