Ik ben wat aan het spelen met PHP, maar ik krijg constant dezelfde foutmelding:
In phpMyAdmin heb ik al gecontroleerd of the veldtypes wel juist zijn. Via Google kwam ik een beschrijving van deze foutmelding tegen:Fatal error: Function name must be a string in C:\xampp\htdocs\test\addtitle.php on line 16.
Maar hier werd ik niet echt wijzer van.This error usually rears its ugly head when you are using variable functions. If you use a variable function and the variable you are using is unset, this error will result - I often get this when I am typing faster than I can think and I accidentally hit $ before a function name. PHP naturally interprets this is a variable-function call, and tries to look up the function name inside the variable.
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
| <html> <head> <title>Add New Booktitle</title> </head> <body> <?php if (isset($_POST['add'])) { include 'library/config.php'; include 'library/opendb.php'; $title = $_POST['title']; $query = "INSERT INTO title (title) VALUES ('$title')"; $mysql_query($query) or die('Error, insert query failed'); include 'library/closedb.php'; echo "New Booktitle added"; } else { ?> <form method="POST"> <table width="400" border="0" cellspacing="1" cellpadding="2"> <tr> <td width="100">Title</td> <td><input name="title" type="text" id="title"></td> </tr> <tr> <td width="100"> </td> <td><input name="add" type="submit" id="add" value="Add New Book Title"></td> </tr> </table> </form> <?php } ?> </body> </html> |