hi all,
zit al een eeuw te programmeren aan een schoolopdracht, maar zit nu echt even met m'n handen in het haar.
Krijg namelijk de volgende error:
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in g:\HTTP-tjv-80\HBO\IP3_2\classes\database.php on line [b]26[b]
bij de volgende code
dit is de volledige code van database.php --> line 26 is de eerste private, wat zie ik over het hoofd.
Ik codeer overigens in PHP 4.2.3
zit al een eeuw te programmeren aan een schoolopdracht, maar zit nu echt even met m'n handen in het haar.
Krijg namelijk de volgende error:
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in g:\HTTP-tjv-80\HBO\IP3_2\classes\database.php on line [b]26[b]
bij de volgende code
PHP:
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
| <?php class Database { function __construct() { $this->host = "localhost"; $this->db = "addicts"; $this->user = "addicts"; $this->link = mysql_connect($this->host, $this->user); mysql_select_db($this->db); } function query($query) { $result = mysql_query($query, $this->link); return $result; } function close() { mysql_close($this->link); } } class Query { private $result; //Result of the query private $position = 0; //ID of the last returned row function __construct($sql) { $this->result = $GLOBALS["db"]->query($sql); } function length() { return mysql_num_rows($this->result); } function getRow() { return mysql_fetch_assoc($this->result); } } ?> |
dit is de volledige code van database.php --> line 26 is de eerste private, wat zie ik over het hoofd.
Ik codeer overigens in PHP 4.2.3