-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAAA_INSTRUCTIONS.php
More file actions
48 lines (37 loc) · 1.27 KB
/
AAA_INSTRUCTIONS.php
File metadata and controls
48 lines (37 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
!!!DATABASE CONNECTION!!!
USAGE:
1) define database constants & store them in connections.php file -> define()
> on local server -> DB_HOST, 'localhost'
2) in process.php page require (not include) connections.php
> require is stricter & upon failure it will also produce a fatal error
3) open connection to mysql database -> $databaseConnect
4) query database -> $query & $data
5) show data in table... ->while (most commmon through loops)
6) close database connection
TIPS & EXPLANATIONS:
> in development stage use or die() to see errors, but in active stage disable errors & remove die() alerts
> store database results in array -> $row = mysqli_fetch_array($data)
*mysqli_fetch_array() -> fetch a result row as an associative array, a numeric array, or both
> show results through database table column names -> $row['date'] & $row['score'] ...
> ALERT <
Timmy
*/
/**
* change the case of array-keys
*
* use: array_change_key_case_ext(array('foo' => 1, 'bar' => 2), ARRAY_KEY_UPPERCASE);
* result: array('FOO' => 1, 'BAR' => 2)
*
* @param array
* @param int
* @return array
*/
UČENJE
variabla
constants and function define()
loops
integer, float
|| !...
?>