PHp error
Mijn source:
<html>
<head>
<meta http-equiv="Content-Language" content="nl-be">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Door</title>
</head>
<body>
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
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
<?
include "config.php";
$select = "SELECT * FROM updates ORDER by id DESC LIMIT 0,10";
$query = mysql_query($select) or die (mysql_error());
while ($list = mysql_fetch_object($query)) {
echo "<table width="50%" border="1" height="192" bordercolor="#000000">
<tr>
<td class="titel" width="34%" height="21">Door:$list->naam @$list->datum</td>
<td class="titel" width="64%" height="21">$list->titel</td>
</tr>
<tr>
<td class="p" height="21">Afbeelding:</td>
<td class="datum" height="21" valign="top">Bericht:</td>
</tr>
<tr>
<td class="p" height="56"><img border="0" src="$list->afbeelding" width="100" height="100"></td>
<td class="p" height="56">$list->bericht</td>
</tr>
<tr>
<td class="p" valign="top"><hr width="100%" size="2" noshade> </td>
<td class="p" valign="top"><hr width="100%" size="2" noshade></td>
</tr>
</table><br><br>";
}
echo "<br>";
?>
include "config.php";
$select = "SELECT * FROM updates ORDER by id DESC LIMIT 0,10";
$query = mysql_query($select) or die (mysql_error());
while ($list = mysql_fetch_object($query)) {
echo "<table width="50%" border="1" height="192" bordercolor="#000000">
<tr>
<td class="titel" width="34%" height="21">Door:$list->naam @$list->datum</td>
<td class="titel" width="64%" height="21">$list->titel</td>
</tr>
<tr>
<td class="p" height="21">Afbeelding:</td>
<td class="datum" height="21" valign="top">Bericht:</td>
</tr>
<tr>
<td class="p" height="56"><img border="0" src="$list->afbeelding" width="100" height="100"></td>
<td class="p" height="56">$list->bericht</td>
</tr>
<tr>
<td class="p" valign="top"><hr width="100%" size="2" noshade> </td>
<td class="p" valign="top"><hr width="100%" size="2" noshade></td>
</tr>
</table><br><br>";
}
echo "<br>";
?>
</body>
</html>
Gebruik eens enkele quotes om een echo mee te beginnen... dus echo '<table blabla bla blabla bla <br>';
moet die br er dan bij?
php moet met enkele quotes ' en html met dubbele quotes "
Alleen query's gebruik ik met dubbele quotes omdat het handiger is.
<html>
<head>
<meta http-equiv="Content-Language" content="nl-be">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Door</title>
</head>
<body>
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
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
<?
include "config.php";
$select = "SELECT * FROM updates ORDER by id DESC LIMIT 0,10";
$query = mysql_query($select) or die (mysql_error());
while ($list = mysql_fetch_object($query)) {
echo "<table width=/"50%/" border=/"1/" height=/"192/" bordercolor=/"#000000/">";
echo "<tr>";
echo "<td class="titel" width="34%" height="21">Door:$list->naam @$list->datum</td>";
echo "<td class="titel" width="64%" height="21">$list->titel</td>";
echo "</tr>";
echo " <tr>";
echo "<td class="p" height="21">Afbeelding:</td>";
echo "<td class="datum" height="21" valign="top">Bericht:</td>";
echo "</tr>";
echo "<tr>";
echo "<td class="p" height="56"><img border="0" src="$list->afbeelding" width="100" height="100"></td>";
echo "<td class="p" height="56">$list->bericht</td>
echo "</tr>";
echo "<tr>";
echo "<td class="p" valign="top"><hr width="100%" size="2" noshade> </td>";
echo "<td class="p" valign="top"><hr width="100%" size="2" noshade></td>";
echo "</tr>";
echo "</table><br><br>";
}
echo "<br>";
?>
include "config.php";
$select = "SELECT * FROM updates ORDER by id DESC LIMIT 0,10";
$query = mysql_query($select) or die (mysql_error());
while ($list = mysql_fetch_object($query)) {
echo "<table width=/"50%/" border=/"1/" height=/"192/" bordercolor=/"#000000/">";
echo "<tr>";
echo "<td class="titel" width="34%" height="21">Door:$list->naam @$list->datum</td>";
echo "<td class="titel" width="64%" height="21">$list->titel</td>";
echo "</tr>";
echo " <tr>";
echo "<td class="p" height="21">Afbeelding:</td>";
echo "<td class="datum" height="21" valign="top">Bericht:</td>";
echo "</tr>";
echo "<tr>";
echo "<td class="p" height="56"><img border="0" src="$list->afbeelding" width="100" height="100"></td>";
echo "<td class="p" height="56">$list->bericht</td>
echo "</tr>";
echo "<tr>";
echo "<td class="p" valign="top"><hr width="100%" size="2" noshade> </td>";
echo "<td class="p" valign="top"><hr width="100%" size="2" noshade></td>";
echo "</tr>";
echo "</table><br><br>";
}
echo "<br>";
?>
</body>
</html>
Dan hoef je ook niet de dubbele quotes in de html te gaan escapen met een \, wat jij nu fout doet met een /.
Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in /home/xtahosted/domains/connectxs.org/public_html/testnieuws.php on line 17
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
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
<?
include "config.php";
$select = "SELECT * FROM updates ORDER by id DESC LIMIT 0,10";
$query = mysql_query($select) or die (mysql_error());
while ($list = mysql_fetch_object($query)) {
echo '<table width="50%" border="1" height="192" bordercolor="#000000">';
echo '<tr>';
echo '<td class="titel" width="34%" height="21">Door:$list->naam @$list->datum</td>';
echo '<td class="titel" width="64%" height="21">$list->titel</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="21">Afbeelding:</td>';
echo '<td class="datum" height="21" valign="top">Bericht:</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="56"><img border="0" src="$list->afbeelding" width="100" height="100"></td>';
echo '<td class="p" height="56">$list->bericht</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade> </td>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade></td>';
echo '</tr>';
echo '</table><br><br>';
}
echo '<br>';
?>
include "config.php";
$select = "SELECT * FROM updates ORDER by id DESC LIMIT 0,10";
$query = mysql_query($select) or die (mysql_error());
while ($list = mysql_fetch_object($query)) {
echo '<table width="50%" border="1" height="192" bordercolor="#000000">';
echo '<tr>';
echo '<td class="titel" width="34%" height="21">Door:$list->naam @$list->datum</td>';
echo '<td class="titel" width="64%" height="21">$list->titel</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="21">Afbeelding:</td>';
echo '<td class="datum" height="21" valign="top">Bericht:</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="56"><img border="0" src="$list->afbeelding" width="100" height="100"></td>';
echo '<td class="p" height="56">$list->bericht</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade> </td>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade></td>';
echo '</tr>';
echo '</table><br><br>';
}
echo '<br>';
?>
Code (php)
1
2
3
2
3
<?
echo '<td class="titel" width="34%" height="21">Door: '.$list->naam.' @'.$list->datum.'</td>';
?>
echo '<td class="titel" width="34%" height="21">Door: '.$list->naam.' @'.$list->datum.'</td>';
?>
i.p.v.
Code (php)
1
2
3
2
3
<?
echo '<td class="titel" width="34%" height="21">Door:$list->naam @$list->datum</td>';
?>
echo '<td class="titel" width="34%" height="21">Door:$list->naam @$list->datum</td>';
?>
Edit: Waar slaat die @ trouwens op? Toch niet om foutmeldingen te onderdrukken? Dan kun je beter je ogen sluiten of je beeldscherm uitschakelen...
Gewijzigd op 01/01/1970 01:00:00 door Frank -
Quote:
Waar slaat die @ trouwens op? Toch niet om foutmeldingen te onderdrukken? Dan kun je beter je ogen sluiten of je beeldscherm uitschakelen...
hahah
nee niet als foutmelding gwn van gepost door blabla @dezetijd
www.connectxs.org/index.php?pagina=testnieuws
hij publiceert het nieuws niet?:s:s:s
<html>
<head>
<meta http-equiv="Content-Language" content="nl-be">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Door</title>
</head>
<body>
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
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
<?
include "config.php";
$select = "SELECT * FROM updates ORDER by id DESC LIMIT 0,10";
$query = mysql_query($select) or die (mysql_error());
while ($list = mysql_fetch_object($query)) {
echo '<table width="50%" border="1" height="192" bordercolor="#000000">';
echo '<tr>';
echo '<td class="titel" width="34%" height="21">Door:'.$list->naam.' @'.$list->datum.'</td>';
echo '<td class="titel" width="64%" height="21">'.$list->titel.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="21">Afbeelding:</td>';
echo '<td class="datum" height="21" valign="top">Bericht:</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="56"><img border="0" src="'.$list->afbeelding.'" width="100" height="100"></td>';
echo '<td class="p" height="56">'.$list->bericht.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade> </td>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade></td>';
echo '</tr>';
echo '</table><br><br>';
}
echo '<br>';
?>
include "config.php";
$select = "SELECT * FROM updates ORDER by id DESC LIMIT 0,10";
$query = mysql_query($select) or die (mysql_error());
while ($list = mysql_fetch_object($query)) {
echo '<table width="50%" border="1" height="192" bordercolor="#000000">';
echo '<tr>';
echo '<td class="titel" width="34%" height="21">Door:'.$list->naam.' @'.$list->datum.'</td>';
echo '<td class="titel" width="64%" height="21">'.$list->titel.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="21">Afbeelding:</td>';
echo '<td class="datum" height="21" valign="top">Bericht:</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="56"><img border="0" src="'.$list->afbeelding.'" width="100" height="100"></td>';
echo '<td class="p" height="56">'.$list->bericht.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade> </td>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade></td>';
echo '</tr>';
echo '</table><br><br>';
}
echo '<br>';
?>
</body>
</html>
Gewijzigd op 01/01/1970 01:00:00 door Manaus
<html>
<head>
<meta http-equiv="Content-Language" content="nl-be">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Door</title>
</head>
<body>
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
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
<?
include "config.php";
$select = "SELECT * FROM updates ORDER by id DESC LIMIT 0,10";
$query = mysql_query($select) or die (mysql_error());
while ($list = mysql_fetch_object($query)) {
echo '<table width="50%" border="1" height="192" bordercolor="#000000">';
echo '<tr>';
echo '<td class="titel" width="34%" height="21">Door:'.$list->naam.' @'.$list->datum.'</td>';
echo '<td class="titel" width="64%" height="21">'.$list->titel.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="21">Afbeelding:</td>';
echo '<td class="datum" height="21" valign="top">Bericht:</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="56"><img border="0" src="'.$list->afbeelding.'" width="100" height="100"></td>';
echo '<td class="p" height="56">'.$list->bericht.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade> </td>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade></td>';
echo '</tr>';
echo '</table><br><br>';
}
echo '<br>';
?>
include "config.php";
$select = "SELECT * FROM updates ORDER by id DESC LIMIT 0,10";
$query = mysql_query($select) or die (mysql_error());
while ($list = mysql_fetch_object($query)) {
echo '<table width="50%" border="1" height="192" bordercolor="#000000">';
echo '<tr>';
echo '<td class="titel" width="34%" height="21">Door:'.$list->naam.' @'.$list->datum.'</td>';
echo '<td class="titel" width="64%" height="21">'.$list->titel.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="21">Afbeelding:</td>';
echo '<td class="datum" height="21" valign="top">Bericht:</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" height="56"><img border="0" src="'.$list->afbeelding.'" width="100" height="100"></td>';
echo '<td class="p" height="56">'.$list->bericht.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade> </td>';
echo '<td class="p" valign="top"><hr width="100%" size="2" noshade></td>';
echo '</tr>';
echo '</table><br><br>';
}
echo '<br>';
?>
</body>
</html>
werkt het al?
ja kijk alleen naam toont hij niet en titel toon hij ook niet...:p
hoe ziet je database structuur er uit dan?
2. Heten de kolomen: 'naam' en 'bericht'?
Krijg je errors?
`datum` varchar(15) NOT NULL default '',
`bericht` varchar(255) NOT NULL default '',
`naam` varchar(255) NOT NULL default '',
`titel` varchar(255) NOT NULL default '',
`id` mediumint(10) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=11 ;
en hij toon ook maar 1 nieuws bericht?:s:s:s
Quote:
Mag ik even een zakdoekje? Hiervan springen me echt de tranen in de ogen. Sinds wanneer is een DATE (of DATETIME) niet meer goed genoeg voor het opslaan van een datum (en evt. tijd) ? Dat is eigenlijk het enige juiste formaat!`datum` varchar(15) NOT NULL default '',
En wat je met die mediumint wilt bereiken snap ik evenmin, een INT voldoet altijd en geeft nooit problemen. Een mediumint heeft zijn beperkingen.
aaaaaaarghhhhhhhhhhhhhhhh sorry mijn fout:P
Zakdoekje op gestuurd met UPS richting Rio de J met track&trace, stuur maar ff pm als je de code wilt.
Vraagje: hebben ze geen zakdoekjes daar? Kan me opzich best voorstellen met een minimum van 25 graden.