<?php
mysql_connect("localhost","spiritanimals","verratnet") or die("Verbindung zur Datenbank gescheitert");
mysql_select_db("spiritanimals") or die("Datenbank nicht vorhanden");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Horses of Freedom</title>
</head>
<body>
<form action="<?php echo $_SERVER[PHP_SELF]; ?>" method="post">
Wähle eine Farbe aus: <br>
<select name="color">
<option>Schimmel</option>
<option>Rappe</option>
<option>Brauner</option>
<option>Fuchs</option>
<option>Pinto</option>
<option>Falbe</option>
</select>
<input type="submit" name="send" value="Finden!">
</form>
<?php
if (isset($_POST[send])) {
$color = $_POST[color];
$sql_select = "SELECT * FROM aussehen WHERE farbe='$color'";
$res = mysql_query($sql_select);
while ($row = mysql_fetch_assoc($res)) {
echo "<table width=400>
<tr><td>Nr. $row[id]</td><td><b>$row[color]</b></td></tr>
<tr><td colspan=2><img src=$row[datei] alt=$row[id], $row[color]></td></tr>
</table>";
?>
</body>
</html>
Und das ist die Fehlermeldung:
Parse error: syntax error, unexpected $end in /usr/export/www/vhosts/funnetwork/hosting/spiritanimals/lillybereich/vph/la
tinoneu/aussehen/suche.php on line 36
Aber es gibt überhaupt gar keine Reihe 36! Deswegen ja...
__________________
Windmill, Windmill for the land.
Turn forever hand in hand
Take it all there on your stride
It is tinking, falling down
Love forever love is free
Let's turn forever you and me
Windmill, windmill for the land
Is everybody in?
Das Problem liegt vermutlich daran, dass du If/While-Klammern angefangen, aber nicht wieder beendet hast.. füge doch vor ?> noch }} ein (es sind ja zwei, die nicht abgeschlossen sind, wenn ich richtig geschaut habe), und sag, ob es geht.. diese Fehlermeldung ist typisch dafür, dass etwas nicht ordnungsgemäss geschlossen wurde.
<?php
mysql_connect("localhost","spiritanimals","verratnet") or die("Verbindung zur Datenbank gescheitert");
mysql_select_db("spiritanimals") or die("Datenbank nicht vorhanden");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Horses of Freedom</title>
</head>
<body>
<form action="<?php echo $_SERVER[PHP_SELF]; ?>" method="post">
Wähle eine Farbe aus: <br>
<select name="color">
<option>Schimmel</option>
<option>Rappe</option>
<option>Brauner</option>
<option>Fuchs</option>
<option>Pinto</option>
<option>Falbe</option>
</select>
<input type="submit" name="send" value="Finden!">
</form>
<?php
if (isset($_POST[send])) {
$color = $_POST[color];
$sql_select = "SELECT * FROM aussehen WHERE farbe='$color'";
$res = mysql_query($sql_select);
while ($row = mysql_fetch_assoc($res)) {
echo "<table width=400>
<tr><td>Nr. $row[id]</td><td><b>$row[color]</b></td></tr>
<tr><td colspan=2><img src=$row[datei] alt=$row[id], $row[color]></td></tr>
</table>"; }}
?>
</body>
</html>
__________________
Windmill, Windmill for the land.
Turn forever hand in hand
Take it all there on your stride
It is tinking, falling down
Love forever love is free
Let's turn forever you and me
Windmill, windmill for the land
Is everybody in?
<?php
mysql_connect("localhost","spiritanimals","verratnet") or die("Verbindung zur Datenbank gescheitert");
mysql_select_db("spiritanimals") or die("Datenbank nicht vorhanden");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Horses of Freedom</title>
</head>
<body>
<form action="<?php echo $_SERVER[PHP_SELF]; ?>" method="post">
Wähle eine Farbe aus: <br>
<select name="color">
<option>Schimmel</option>
<option>Rappe</option>
<option>Brauner</option>
<option>Fuchs</option>
<option>Pinto</option>
<option>Falbe</option>
</select>
<input type="submit" name="send" value="Finden!">
</form>
<?php
if (isset($_POST[send])) {
$color = $_POST[farbe];
$sql_select = "SELECT * FROM aussehen WHERE farbe='$farbe'";
$res = mysql_query($sql_select);
}
while ($row = mysql_fetch_assoc($res)) {
echo "<table width=400>
<tr><td>Nr. $row[id]</td><td><b>$row[color]</b></td></tr>
<tr><td colspan=2><img src=$row[datei] alt=$row[id], $row[farbe]></td></tr>
</table>";
}
?>
</body>
</html>
__________________
Windmill, Windmill for the land.
Turn forever hand in hand
Take it all there on your stride
It is tinking, falling down
Love forever love is free
Let's turn forever you and me
Windmill, windmill for the land
Is everybody in?
Dabei seit: 07.04.2006
Beiträge: 2.364
Herkunft: Hessen
Themenstarter
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/export/www/vhosts/funnetwork/hosting/spiritanimals/lillybereich/vph/la
tinoneu/aussehen/suche.php on line 30
Das ist die Fehlermeldung.
@May-Britt: Hab ich, geht trotzdem nicht.
__________________
Windmill, Windmill for the land.
Turn forever hand in hand
Take it all there on your stride
It is tinking, falling down
Love forever love is free
Let's turn forever you and me
Windmill, windmill for the land
Is everybody in?
Dabei seit: 07.04.2006
Beiträge: 2.364
Herkunft: Hessen
Themenstarter
edit: Problem hat sich gelöst. Bei PHPmyAdmin hatte ich die Datei Aussehen genannt, und im PHP code aussehen. Also Groß und klein Schreibungsfehler!
__________________
Windmill, Windmill for the land.
Turn forever hand in hand
Take it all there on your stride
It is tinking, falling down
Love forever love is free
Let's turn forever you and me
Windmill, windmill for the land
Is everybody in?
Dieser Beitrag wurde 3 mal editiert, zum letzten Mal von SammyLG: 11.01.2007 10:53.