Ik ben al een tijdje met volle irritatie bezig, want niets lukt.
Ik heb een tabel aangemaakt met de volgende query:
In een config.inc filetje de benodigde gegevens over mysql en database
De PHP code ziet er als volgt uit (index.php)
Ik krijg dan de volgende foutmelding:
Dat geeft deze fijne error:
De apache log laat deze foutmelding zien:
Ik heb dus sterk het vermoeden dat mijn webserver (apache/php/mysql/perl) niet goed is geinstalleerd?
Ik heb een tabel aangemaakt met de volgende query:
code:
1
2
3
4
5
6
7
8
| CREATE TABLE guestbook ( name varchar(50), date varchar(40), email varchar(50), comment longtext, id int(4) DEFAULT '0' NOT NULL auto_increment, PRIMARY KEY (id) ); |
In een config.inc filetje de benodigde gegevens over mysql en database
De PHP code ziet er als volgt uit (index.php)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
| <? include ("config.inc"); //connect mysql_pconnect( "localhost", "$username", "$password") or die( "Unable to connect to SQL server"); mysql_select_db( "$db_name") or die( "Unable to select database"); $numresults=mysql_query("SELECT name, date, email, comment FROM guestbook"); $numrows=mysql_num_rows($numresults) or die ("query 1 failed"); if (empty($offset)) { $offset=0; } $query = "SELECT name, date, email, comment FROM guestbook order by date DESC limit $offset,$limit"; $result = mysql_query ($query) or die ("query 2 failed"); while ($row = mysql_fetch_row ($result)) { for ($i = 0; $i < mysql_num_fields ($result); $i++) { if ($i > 0) print ("<br>"); if ($i == 0){ print "<b>Name: </b>"; } else if ($i == 1){ print "<b>Date: </b>"; } else if ($i == 2){ print "<b>Email: </b>"; } else{ print "<b>Comment:</b><br>"; } print ($row[$i]); } print "<br><br><center><img src='black.gif' width=590 height=1 border=0></center>"; print ("<P>"); } if ($offset >= 3) { $prevoffset = $offset - $limit; print "<a href=\"index.php?offset=$prevoffset\">PREV</a> \n"; } $pages=intval($numrows/$limit); if ($pages < ($numrows/$limit)){ $pages=($pages + 1); } for ($i = 1; $i <= $pages; $i++) { $newoffset = $limit*($i-1); if ($newoffset == $offset) { print "$i \n"; } else { print "<a href=\"index.php?offset=$newoffset\">$i</a> \n"; } } //show next if not last if (! ( ($offset/$limit) == ($pages - 1) ) && ($pages != 1) ) { $newoffset = $offset+$limit; print "<a href=\"index.php?offset=$newoffset\">NEXT</a><p>\n"; } ?> |
Ik krijg dan de volgende foutmelding:
code:
1
2
3
4
5
6
7
8
9
10
| ----------------------------------------- Post a message to this guestbook powered by markey d. query 1 failed ----------------------------------------- "Post a message to this guestbook" is een link naar de pagina met dit stukje script: |
PHP:
1
2
3
4
5
| <? include ("config.inc"); echo $error1; ?> |
Dat geeft deze fijne error:
code:
1
2
3
4
5
6
7
8
9
| ------------------------------------------ Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, jeppa78@hotmail.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. -------------------------------------------- |
De apache log laat deze foutmelding zien:
code:
1
2
3
| ------------------------------------------- [Thu Aug 15 14:08:52 2002] [error] [client 192.168.0.2] Premature end of script headers: c:/php/php.exe |
Ik heb dus sterk het vermoeden dat mijn webserver (apache/php/mysql/perl) niet goed is geinstalleerd?
[ Voor 0% gewijzigd door D2k op 15-08-2002 14:58 . Reden: D2k edit: php tags+ code tags ]