-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram1.php
More file actions
42 lines (35 loc) · 788 Bytes
/
program1.php
File metadata and controls
42 lines (35 loc) · 788 Bytes
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
<html><body>
<?php
/**
* Echos my name
*/
function echo_my_name() {
$name = 'Yehan';
echo 'Your name is ' . $name . '.';
}
echo_my_name();
include_once 'student_data.php';
include_once 'variables.php';
$student = new Student_data();
$student->get_first_name();
$student->get_last_name();
$student->get_level();
echo $variable1 . $variable2 . '<br />' . '<br />';
mysql_connect('localhost', 'root', 'root');
mysql_select_db('awtweb');
$result = mysql_query('SELECT * FROM `book`');
if (is_resource($result)) {
while ($row = mysql_fetch_row($result)) {
var_dump($row);
}
mysql_free_result($result);
}
function testGlobal() {
$variable1 = 'something';
echo $variable1;
global $variable1;
echo $variable1;
}
testGlobal();
?>
</body></html>