PHP

Summary of the basics of PHP-code

Get Started. It's Free
or sign up with your email address
Rocket clouds
PHP by Mind Map: PHP

1. basis

1.1. <?php ... ?>

1.2. variabelen

1.2.1. $strvar="...";

1.2.2. $intvar=123;

1.3. commentaar

1.3.1. //

1.3.2. /* ... *//

1.4. strings

1.4.1. $str1="yyy" . "xxx";

1.4.2. echo $str1;

2. Operatoren

2.1. "is gelijk aan"- operatoren

2.1.1. =

2.1.2. += en -=

2.1.3. *= en /=

2.1.4. %=

2.1.5. .=

2.2. logische operatoren

2.2.1. &&

2.2.2. ||

2.2.3. !

2.3. vergelijkings- operatoren

2.3.1. ==

2.3.2. !=

2.3.3. < en >

2.3.4. <= en >=

2.4. wiskundige operatoren

2.4.1. + en -

2.4.2. * en /

2.4.3. %

2.4.4. ++ en --

3. condities

3.1. if ($var=="waarde") {...} eslseif ($var=="waarde") {...} else {...}

4. loops

4.1. while ($var<="waarde") {...}

4.2. for ($i=1; $i<=10; $i++) {...}

5. databases

5.1. verbinding maken

5.1.1. $con=mysql_connect(“server”, “gebruikersnaam”, “wachtwoord”);

5.1.2. mysql_select_db("database", $con);

5.2. records ophalen

5.2.1. $resultaat=mysql_query("SELECT * FROM Tabel"); while($record = mysql_fetch_array($resultaat)) { echo $record['veld1'] . " " . $record['veld2']; }

5.3. records invoegen, updaten en deleten

5.3.1. if (!mysql_query($strSQL,$con)) die ('...' . mysql_error());